Skip to content

Commit 2a1771d

Browse files
committed
fix: don't report missing routes as internal exceptions
1 parent 7135a94 commit 2a1771d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sentry_sdk/integrations/django.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ def _make_event_processor(self, request):
5656

5757
def processor(event):
5858
if "transaction" not in event:
59-
with _internal_exceptions():
59+
try:
6060
event["transaction"] = resolve(request.path).func.__name__
61+
except Exception:
62+
pass
6163

6264
with _internal_exceptions():
6365
DjangoRequestExtractor(request).extract_into_event(

sentry_sdk/integrations/flask.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ def _make_event_processor():
5151
def event_processor(event):
5252
if request:
5353
if "transaction" not in event:
54-
with _internal_exceptions():
54+
try:
5555
event["transaction"] = request.url_rule.endpoint
56+
except Exception:
57+
pass
5658

5759
with _internal_exceptions():
5860
FlaskRequestExtractor(request).extract_into_event(event, client_options)

0 commit comments

Comments
 (0)