Skip to content

extractors

Error detail extraction utilities.

Functions:

Functions

unwrap_error

Python
unwrap_error(error: Any) -> Exception

Unwrap nested exceptions to find root cause.

Returns:

  • Exception

    The unwrapped root exception.

fallback_format_message

Python
fallback_format_message(message_format: str, error: Exception) -> str

Safely format error message with fallbacks.

Returns:

  • str

    The formatted error message.

format_list

Python
format_list(items: list[str]) -> str

Format list as comma-separated code blocks.

Returns:

  • str

    Comma-separated list in code blocks.

extract_missing_role_details

Python
extract_missing_role_details(error: Exception, **kwargs: Any) -> dict[str, Any]

Extract missing role details.

Returns:

  • dict[str, Any]

    Dictionary containing role information.

extract_missing_any_role_details

Python
extract_missing_any_role_details(error: Exception, **kwargs: Any) -> dict[str, Any]

Extract missing roles list.

Returns:

  • dict[str, Any]

    Dictionary containing roles information.

extract_permissions_details

Python
extract_permissions_details(error: Exception, **kwargs: Any) -> dict[str, Any]

Extract missing permissions.

Returns:

  • dict[str, Any]

    Dictionary containing permissions information.

extract_bad_flag_argument_details

Python
extract_bad_flag_argument_details(error: Exception, **kwargs: Any) -> dict[str, Any]

Extract flag argument details.

Parameters:

  • error (Exception) –

    The bad flag argument error.

  • **kwargs (Any, default: {} ) –

    Additional context, may include 'source' for command information.

Returns:

  • dict[str, Any]

    Dictionary containing flag details, original cause, and usage information.

extract_missing_flag_details

Python
extract_missing_flag_details(error: Exception, **kwargs: Any) -> dict[str, Any]

Extract missing flag details.

Parameters:

  • error (Exception) –

    The missing flag error.

  • **kwargs (Any, default: {} ) –

    Additional context, may include 'source' for command information.

Returns:

  • dict[str, Any]

    Dictionary containing flag name and usage information.

extract_httpx_status_details

Python
extract_httpx_status_details(error: Exception, **kwargs: Any) -> dict[str, Any]

Extract HTTPX status error details.

Returns:

  • dict[str, Any]

    Dictionary containing status code, URL, and response text.

extract_missing_argument_details

Python
extract_missing_argument_details(error: Exception, **kwargs: Any) -> dict[str, Any]

Extract missing argument details.

Parameters:

  • error (Exception) –

    The missing argument error.

  • **kwargs (Any, default: {} ) –

    Additional context, may include 'source' for command information.

Returns:

  • dict[str, Any]

    Dictionary containing parameter name and usage information.

extract_bad_union_argument_details

Python
extract_bad_union_argument_details(error: Exception, **kwargs: Any) -> dict[str, Any]

Extract bad union argument details.

Parameters:

  • error (Exception) –

    The bad union argument error.

  • **kwargs (Any, default: {} ) –

    Additional context, may include 'source' for command information.

Returns:

  • dict[str, Any]

    Dictionary containing argument, expected types, and usage information.

extract_permission_denied_details

Python
extract_permission_denied_details(error: Exception, **kwargs: Any) -> dict[str, Any]

Extract permission denied error details.

Parameters:

  • error (Exception) –

    The permission denied error.

  • **kwargs (Any, default: {} ) –

    Additional context, may include 'ctx' for command context.

Returns:

  • dict[str, Any]

    Dictionary containing formatted permission message.