Skip to content

Simplify error reporting #2

@barseghyanartur

Description

@barseghyanartur

Take Sentry SDK as a good example of such.

Capture errors

https://docs.sentry.io/platforms/python/#capturing-errors

from sentry_sdk import capture_exception

try:
    a_potentially_failing_function()
except Exception as e:
    # Alternatively the argument can be omitted
    capture_exception(e)

Capture messages

https://docs.sentry.io/error-reporting/capturing/?platform=python#capturing-messages

from sentry_sdk import capture_message

capture_message('Something went wrong')

Extra context

https://docs.sentry.io/platforms/python/#extra-context

from sentry_sdk import configure_scope

with configure_scope() as scope:
    scope.set_extra("character_name", "Mighty Fighter")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions