InvergeDocs
PythonAPI reference

Errors

Error monitoring — report exceptions and error messages from your backend.

// access
client.errors

Error monitoring — report exceptions and error messages from your backend.

SymbolKindSummary
Errorsclassclient.errors
stack_frames()functionNormalised {function, filename, lineno} frames the console renders.
exception_fingerprint()functionA stable group key: exception type + the deepest frame that raised it.

Errors

class

client.errors

Extends Resource.

View source

capture()

method
def capture(message, *, type=None, level=None, handled=None, fingerprint=None, stack=None, context=None, release=None, url=None, distinct_id=None, session_key=None, device_key=None, os_type=None, os_version=None, browser=None, app_version=None, **extra_context) -> Dict[str, Any]

Report an error by message.

client.errors.capture("Payment gateway timeout",
                      type="GatewayTimeout", fingerprint="gateway-timeout")

Parameters

Prop

Type

Returns Dict[str, Any]

View source

capture_exception()

method
def capture_exception(exc=None, *, handled=True, level='error', fingerprint=None, include_cause=True, **options) -> Dict[str, Any]

Report a caught exception, with its type, message and stack.

Pass the exception, or call it bare inside an except block and the SDK reads sys.exc_info:

try:
    charge(order)
except PaymentError:
    client.errors.capture_exception(context={"order": order.id})

Parameters

Prop

Type

Returns Dict[str, Any]

View source

capture_exc_info()

method
def capture_exc_info(exc_info, **options) -> Dict[str, Any]

Report from a sys.exc_info triple (handy in log handlers).

Parameters

Prop

Type

Returns Dict[str, Any]

View source

Functions

stack_frames()

function
def stack_frames(exc=None, tb=None, *, limit=100) -> List[Dict[str, Any]]

Normalised {function, filename, lineno} frames the console renders.

Frames come back throw-site first (the reverse of traceback.extract_tb), matching the other Nexus SDKs so the first line in the console is where it broke.

Parameters

Prop

Type

Returns List[Dict[str, Any]]

View source

exception_fingerprint()

function
def exception_fingerprint(exc) -> str

A stable group key: exception type + the deepest frame that raised it.

Parameters

Prop

Type

Returns str

View source

On this page