Skip to content

Commit c510ced

Browse files
authored
fix(sessions): Only crash session if the error is unhandled, not if it is fatal (#754)
Exceptions that are fatal but handled are probably log messages. Log messages are not really crashes. If we capture crashes as log messages only, we should fix that first by writing more integrations or fixing bugs in existing ones.
1 parent b718925 commit c510ced

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

sentry_sdk/client.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -267,20 +267,14 @@ def _update_session_from_event(
267267
errored = False
268268
user_agent = None
269269

270-
# Figure out if this counts as an error and if we should mark the
271-
# session as crashed.
272-
level = event.get("level")
273-
if level == "fatal":
274-
crashed = True
275-
if not crashed:
276-
exceptions = (event.get("exception") or {}).get("values")
277-
if exceptions:
278-
errored = True
279-
for error in exceptions:
280-
mechanism = error.get("mechanism")
281-
if mechanism and mechanism.get("handled") is False:
282-
crashed = True
283-
break
270+
exceptions = (event.get("exception") or {}).get("values")
271+
if exceptions:
272+
errored = True
273+
for error in exceptions:
274+
mechanism = error.get("mechanism")
275+
if mechanism and mechanism.get("handled") is False:
276+
crashed = True
277+
break
284278

285279
user = event.get("user")
286280

0 commit comments

Comments
 (0)