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 #[unsafe(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
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
gen_napi_error_class
Generate a #[napi] companion struct for error introspection, exposing the whitelisted methods as #[napi] getter methods.
gen_napi_error_converter
Generate a converter function that maps a core error to napi::Error.
gen_napi_error_types
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
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
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.
go_error_sentinel_name
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, code, status_code, is_transient, error_type).
pyo3_error_info_field_specs
Field specs (name, Python type annotation) for the {Error}Info companion class, derived from error.methods. code is always present; the rest are whitelisted introspection methods the error type actually implements. Shared by gen_pyo3_error_methods_impl (the native #[pyclass]) and the pyo3 backend’s .pyi stub generator so the two can never drift on which fields the info class exposes.
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.