Skip to main content

Module error_gen

Module error_gen 

Source

Functions§

acronym_aware_snake_phrase
Convert a PascalCase variant name into a human readable phrase that preserves canonical acronyms.
converter_fn_name
Return the converter function name for a given error type.
gen_csharp_error_types
Generate C# exception sub-classes for each error variant.
gen_ffi_error_codes
Generate a C enum of error codes plus an error-message function declaration.
gen_ffi_error_methods
Generate #[no_mangle] extern "C" helper functions for the whitelisted introspection methods (status_code, is_transient, error_type) declared in error.methods.
gen_go_error_struct
Generate the structured error type (struct + Error() method) for a single error definition. Sentinel errors are emitted separately by gen_go_sentinel_errors.
gen_go_error_types
Generate Go sentinel errors and a structured error type for an ErrorDef.
gen_go_sentinel_errors
Generate a single consolidated var (...) block of Go sentinel errors across multiple ErrorDefs.
gen_java_error_types
Generate Java exception sub-classes for each error variant.
gen_magnus_error_converter
Generate a converter function that maps a core error to magnus::Error.
gen_magnus_error_methods_struct
Generate a Magnus-wrapped Rust struct that stores the whitelisted error introspection method return values and exposes them as Ruby instance methods.
gen_napi_error_class
Generate a #[napi] class struct for the error type that stores the whitelisted introspection method values as fields and exposes them as methods.
gen_napi_error_converter
Generate a converter function that maps a core error to napi::Error.
gen_napi_error_types
Generate a JsError enum with string constants for each error variant name.
gen_php_error_converter
Generate a converter function that maps a core error to PhpException.
gen_php_error_methods_impl
Generate a #[php_class] + #[php_impl] block for the error type, storing the whitelisted introspection method return values as Rust fields exposed via #[php_method].
gen_pyo3_error_converter
Generate a to_py_err converter function that maps each Rust error variant to a Python exception. Uses Error-suffixed names for variant exceptions (N818 compliance).
gen_pyo3_error_methods_impl
Generate a #[pyclass] companion struct for error introspection, exposing the whitelisted methods as #[getter] properties.
gen_pyo3_error_registration
Generate m.add(...) registration calls for each exception type. Uses Error-suffixed names for variant exceptions (N818 compliance). Prefixes names that would shadow Python builtins (A004 compliance).
gen_pyo3_error_types
Generate pyo3::create_exception! macros for each error variant plus the base error type. Appends “Error” suffix to variant names that don’t already have it (N818 compliance). Prefixes names that would shadow Python builtins (A004 compliance).
gen_rustler_error_converter
Generate a converter function that maps a core error to a Rustler error tuple {:error, reason}.
gen_wasm_error_converter
Generate a converter function that maps a core error to a JsValue object with code (string) and message (string) fields, plus a private error_code helper that returns the variant code string.
gen_wasm_error_methods
Generate a #[wasm_bindgen] opaque struct for an error type together with an impl block that exposes the whitelisted introspection methods (status_code, is_transient, error_type) declared in error.methods.
magnus_converter_fn_name
Return the Magnus converter function name for a given error type.
magnus_error_methods_registrations
Returns the define_class + define_method registration lines for the error info struct.
napi_converter_fn_name
Return the NAPI converter function name for a given error type.
php_converter_fn_name
Return the PHP converter function name for a given error type.
pyo3_error_has_methods
Returns true when the error has whitelisted introspection methods that require extended constructor args (msg, status_code, is_transient, error_type).
pyo3_error_info_fn_name
Return the name of the free function that builds the companion info struct.
pyo3_error_info_struct_name
Return the name of the companion info struct for an error type.
python_exception_name
Return the Python exception name for a variant, avoiding shadowing of Python builtins.
rustler_converter_fn_name
Return the Rustler converter function name for a given error type.
strip_thiserror_placeholders
Strip thiserror-style {name} placeholders from a Display template without leaving stray punctuation.
wasm_converter_fn_name
Return the WASM converter function name for a given error type.