Skip to content

Commit 791d525

Browse files
committed
Added ignored errors
1 parent a5cc215 commit 791d525

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

backend/PyMatcha/__init__.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,23 @@ def expired_token_callback(expired_token):
184184
logging.debug("Configuring JWT user callback loader")
185185

186186

187-
from PyMatcha.utils.errors import NotFoundError
187+
from PyMatcha.utils.errors import NotFoundError, BadRequestError, ConflictError, UnauthorizedError, ForbiddenError
188+
189+
190+
def before_send(event, hint):
191+
if "exc_info" in hint:
192+
exc_type, exc_value, tb = hint["exc_info"]
193+
if isinstance(exc_value, (NotFoundError, BadRequestError, ConflictError, UnauthorizedError, ForbiddenError)):
194+
return None
195+
return event
196+
197+
198+
sentry_sdk.init(
199+
dsn="https://bb17c14c99d448e2804bf2f105d4ec52@o450203.ingest.sentry.io/5434438",
200+
integrations=[FlaskIntegration()],
201+
traces_sample_rate=1.0,
202+
before_send=before_send,
203+
)
188204

189205

190206
@jwt.user_loader_callback_loader

0 commit comments

Comments
 (0)