Skip to content

utils

Sentry utility functions for specialized error reporting.

Functions:

Classes

Functions

capture_exception_safe

Python
capture_exception_safe(
    error: Exception,
    *,
    extra_context: dict[str, Any] | None = None,
    capture_locals: bool = False,
) -> None

Safely capture an exception with optional context and locals.

capture_tux_exception

Python
capture_tux_exception(
    error: TuxError,
    *,
    command_name: str | None = None,
    user_id: str | None = None,
    guild_id: str | None = None,
) -> None

Capture a TuxError with specialized context.

capture_database_error

Python
capture_database_error(
    error: Exception,
    *,
    query: str | None = None,
    table: str | None = None,
    operation: str | None = None,
) -> None

Capture a database-related error with context.

capture_cog_error

Python
capture_cog_error(
    error: Exception,
    *,
    cog_name: str,
    command_name: str | None = None,
    event_name: str | None = None,
) -> None

Capture a cog-related error with context.

capture_api_error

Python
capture_api_error(
    error: Exception,
    *,
    endpoint: str | None = None,
    status_code: int | None = None,
    response_data: dict[str, Any] | None = None,
) -> None

Capture an API-related error with context.