Errors
Error monitoring — report exceptions and error messages from your backend.
// access
client.errorsError monitoring — report exceptions and error messages from your backend.
| Symbol | Kind | Summary |
|---|---|---|
Errors | class | client.errors |
stack_frames() | function | Normalised {function, filename, lineno} frames the console renders. |
exception_fingerprint() | function | A stable group key: exception type + the deepest frame that raised it. |
Errors
classclient.errors
Extends Resource.
capture()
methoddef 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]
capture_exception()
methoddef 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]
capture_exc_info()
methoddef 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]
Functions
stack_frames()
functiondef 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]]
exception_fingerprint()
functiondef exception_fingerprint(exc) -> strA stable group key: exception type + the deepest frame that raised it.
Parameters
Prop
Type
Returns str
