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 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 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).
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.