Generate the structured error type (struct + Error() method) for a single
error definition. Sentinel errors are emitted separately by
gen_go_sentinel_errors.
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].
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).
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).
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.
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.
Returns true when the error has whitelisted introspection methods that
require extended constructor args (msg, code, status_code, is_transient, error_type).
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.