File tree Expand file tree Collapse file tree
backend/pennmobile/settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import sentry_sdk
44from sentry_sdk .integrations .celery import CeleryIntegration
55from sentry_sdk .integrations .django import DjangoIntegration
6+ from sentry_sdk .types import Event , Hint
67
78from pennmobile .settings .base import * # noqa: F401, F403
89from pennmobile .settings .base import DOMAINS , REDIS_URL
2122
2223# Sentry settings
2324SENTRY_URL = os .environ .get ("SENTRY_URL" , "" )
24- sentry_sdk .init (dsn = SENTRY_URL , integrations = [CeleryIntegration (), DjangoIntegration ()])
25+
26+
27+ def before_send (event : Event , hint : Hint | None ) -> Event | None :
28+ logentry = event .get ("logentry" )
29+ if isinstance (logentry , dict ):
30+ message = logentry .get ("message" )
31+ if isinstance (message , str ) and "Wharton: Error 403 when reserving data" in message :
32+ return None
33+ return event
34+
35+
36+ sentry_sdk .init (
37+ dsn = SENTRY_URL ,
38+ integrations = [CeleryIntegration (), DjangoIntegration ()],
39+ before_send = before_send ,
40+ )
2541
2642# DLA settings
2743PLATFORM_ACCOUNTS = {"ADMIN_PERMISSION" : "penn_mobile_admin" }
You can’t perform that action at this time.
0 commit comments