Skip to content

fix(sessions): Only crash session if the error is unhandled, not if it is fatal #754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions sentry_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,20 +267,14 @@ def _update_session_from_event(
errored = False
user_agent = None

# Figure out if this counts as an error and if we should mark the
# session as crashed.
level = event.get("level")
if level == "fatal":
crashed = True
if not crashed:
exceptions = (event.get("exception") or {}).get("values")
if exceptions:
errored = True
for error in exceptions:
mechanism = error.get("mechanism")
if mechanism and mechanism.get("handled") is False:
crashed = True
break
exceptions = (event.get("exception") or {}).get("values")
if exceptions:
errored = True
for error in exceptions:
mechanism = error.get("mechanism")
if mechanism and mechanism.get("handled") is False:
crashed = True
break

user = event.get("user")

Expand Down