error_handler_middleware
Function
Global error handling with a message to the user.
from discord_interactions import error_handler_middlewareSignature
def error_handler_middleware( *, send_error_to_user: bool = True, error_message: str = 'An error occurred while processing your command.', log_errors: bool = True, on_error: Callable[[SlashContext, Exception], Awaitable[None]] | None = None,) -> MiddlewareParameters
| Name | Type | Default | Description |
|---|---|---|---|
send_error_to_user | bool | True | |
error_message | str | 'An error occurred while processing your command.' | |
log_errors | bool | True | |
on_error | Callable[[SlashContext, Exception], Awaitable[None]] | None | None |
Returns
Middleware