Skip to content

Commit

Permalink
Merge pull request #873 from opendatacube/sentry-filter
Browse files Browse the repository at this point in the history
make sentry ignore geom error from shapelh
  • Loading branch information
SpacemanPaul authored Sep 26, 2022
2 parents 21daeb2 + d0d9a74 commit 4c4f991
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion datacube_ows/startup_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ def initialise_debugging(log=None):
if log:
log.info("PyCharm Debugging enabled")

def before_send(event, hint):
if 'exc_info' in hint:
exc_type, exc_value, tb = hint['exc_info']
if tb == 'Failed to delete GEOS geom':
return None
return event

def initialise_sentry(log=None):
if os.environ.get("SENTRY_DSN"):
Expand All @@ -67,7 +73,8 @@ def initialise_sentry(log=None):
sentry_sdk.init(
dsn=os.environ["SENTRY_DSN"],
environment=SENTRY_ENV_TAG,
integrations = [FlaskIntegration()]
integrations = [FlaskIntegration()],
before_send=before_send,
)
if log:
log.info("Sentry initialised")
Expand Down

0 comments on commit 4c4f991

Please sign in to comment.