Skip to main content

python_exception_name

Function python_exception_name 

Source
pub fn python_exception_name(variant_name: &str, error_name: &str) -> String
Expand description

Return the Python exception name for a variant, avoiding shadowing of Python builtins.

  1. Appends "Error" suffix if not already present (N818 compliance).
  2. If the resulting name shadows a Python builtin, prefixes it with the error type’s base name. E.g. for CrawlError::Connection -> ConnectionError (shadowed) -> CrawlConnectionError.