Skip to content

Commit 4cfe699

Browse files
committed
ref: Simplify the dedupe processor
1 parent 0e0e970 commit 4cfe699

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

sentry_sdk/integrations/dedupe.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,10 @@ def install(self):
1414
with configure_scope() as scope:
1515

1616
@scope.add_error_processor
17-
def processor(event, error):
18-
exc_info = event.get("__sentry_exc_info")
19-
if exc_info and exc_info[1] is not None:
20-
exc = exc_info[1]
21-
if last_seen.get(None) is exc:
22-
seen = True
23-
else:
24-
seen = False
25-
last_seen.set(exc)
26-
if seen:
27-
return None
17+
def processor(event, exc_info):
18+
exc = exc_info[1]
19+
if last_seen.get(None) is exc:
20+
return
21+
seen = False
22+
last_seen.set(exc)
2823
return event

sentry_sdk/scope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def apply_to_event(self, event):
8585
event.setdefault("contexts", {}).update(contexts)
8686

8787
exc_info = event.get("__sentry_exc_info", None)
88-
if exc_info is not None:
88+
if exc_info and exc_info[0] is not None:
8989
for processor in self._error_processors:
9090
event = processor(event, exc_info)
9191
if event is None:

0 commit comments

Comments
 (0)