error-handling-strategy

Standardize error handling patterns across Python, Rust, TypeScript, Ruby, and Go.

836|66|Updated Feb 3, 2025
One-click install
npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill error-handling-strategy-kreuzberg-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling-strategy
Source: https://github.com/kreuzberg-dev/html-to-markdown/tree/main/.codex/skills/error-handling-strategy
Command: npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill error-handling-strategy-kreuzberg-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a standardized, robust strategy for handling errors across multiple programming languages, ensuring consistency and preventing silent failures.

Core Features & Use Cases

  • Polyglot Error Standardization: Defines consistent error handling patterns for Python, Rust, TypeScript, Ruby, Go, and Java.
  • FFI Boundary Safety: Ensures errors are correctly converted and context is preserved when crossing language boundaries (e.g., between Rust and Python).
  • Use Case: When integrating a Rust library into a Python application, this strategy ensures that Rust's Result types are properly translated into Python exceptions, maintaining error context and preventing unexpected crashes.

Quick Start

Apply the error-handling-strategy skill to ensure all OSError and RuntimeError exceptions are bubbled up in Python and Rust code.

Frequently Asked Questions about error-handling-strategy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I preserve error context when crossing FFI boundaries between Python and Rust?

This strategy standardizes polyglot error handling by implementing typed error classes and wrapping patterns that translate Rust Result types into Python exceptions, preserving full error context and preventing silent failures across language boundaries.

What is the best way to standardize exception management across multiple programming languages?

Standardizing exception management across polyglot environments requires implementing consistent error handling patterns for Python, Rust, TypeScript, Ruby, and Go. This strategy defines exception hierarchies and typed error classes to ensure consistent behavior and prevent unexpected crashes.

Does this error handling strategy support both OSError and RuntimeError bubbling in Python?

Yes, this error handling strategy explicitly addresses bubbling up OSError and RuntimeError exceptions in Python and Rust code. It ensures OS errors and runtime exceptions are correctly propagated without being silently swallowed.

Can I use this strategy to handle errors when integrating a Rust library into a Python application?

Yes, integrating a Rust library into a Python application is a core use case. The strategy ensures Rust Result types are properly translated into Python exceptions, maintaining error context and preventing unexpected crashes at the FFI boundary.

What programming languages are covered by this polyglot error handling approach?

This polyglot error handling approach defines consistent error handling patterns for Python, Rust, TypeScript, Ruby, and Go. It addresses critical requirements for bubbling up OS errors and runtime exceptions across these language environments.