mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Fix TaskErrors being reported to Sentry
This commit is contained in:
parent
662c632f5d
commit
faddf11f77
@ -35,6 +35,14 @@ from sentry_sdk.integrations.flask import FlaskIntegration
|
||||
|
||||
|
||||
if os.getenv("SENTRY_DSN"):
|
||||
def before_send(event, hint):
|
||||
from app.tasks import TaskError
|
||||
if "exc_info" in hint:
|
||||
exc_type, exc_value, tb = hint["exc_info"]
|
||||
if isinstance(exc_value, TaskError):
|
||||
return None
|
||||
return event
|
||||
|
||||
environment = os.getenv("SENTRY_ENVIRONMENT")
|
||||
assert environment is not None
|
||||
sentry_sdk.init(
|
||||
@ -49,6 +57,8 @@ if os.getenv("SENTRY_DSN"):
|
||||
# of sampled transactions.
|
||||
# We recommend adjusting this value in production.
|
||||
profiles_sample_rate=1.0,
|
||||
|
||||
before_send=before_send,
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user