You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an error occurs in a user's traces_sampler function, this can cause an unhandled exception, which may in some cases not even be reported to Sentry (see #2582).
This program will crash with the ZeroDivisionError. In this case, the exception does get reported to Sentry via excepthook, but that will not always be the case (e.g. if the exception is not fatal).
When calling our other user-defined callbacks, such as before_send or before_send_transaction, we wrap the calls in a with capture_internal_exceptions block. You can therefore observe that the following example simply prints "hello, world!" without any errors.
We should likely also wrap traces_sampler calls in capture_internal_exceptions to prevent these errors from causing crashes and other undesirable behavior.
The text was updated successfully, but these errors were encountered:
If an error occurs in a user's
traces_sampler
function, this can cause an unhandled exception, which may in some cases not even be reported to Sentry (see #2582).As an example, try running the following code:
This program will crash with the ZeroDivisionError. In this case, the exception does get reported to Sentry via excepthook, but that will not always be the case (e.g. if the exception is not fatal).
When calling our other user-defined callbacks, such as
before_send
orbefore_send_transaction
, we wrap the calls in awith capture_internal_exceptions
block. You can therefore observe that the following example simply prints "hello, world!" without any errors.We should likely also wrap
traces_sampler
calls incapture_internal_exceptions
to prevent these errors from causing crashes and other undesirable behavior.The text was updated successfully, but these errors were encountered: