Skip to content

formatter

Error message formatting utilities.

Classes:

  • ErrorFormatter

    Formats errors into user-friendly Discord embeds.

Classes

ErrorFormatter

Formats errors into user-friendly Discord embeds.

Methods:

Functions

format_error_embed
Python
format_error_embed(
    error: Exception, source: Context[Tux] | Interaction, config: ErrorHandlerConfig
) -> Embed

Create user-friendly error embed.

Returns:

  • Embed

    Formatted error embed for display.

_format_error_message
Python
_format_error_message(
    error: Exception, source: Context[Tux] | Interaction, config: ErrorHandlerConfig
) -> str

Format error message using configuration.

Returns:

  • str

    Formatted error message.

_get_command_usage
Python
_get_command_usage(ctx: Context[Tux]) -> str | None

Get command usage string.

Returns:

  • str | None

    Command usage string if available, None otherwise.

get_error_config
Python
get_error_config(error: Exception) -> ErrorHandlerConfig

Get configuration for error type.

Returns:

Functions