Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
(PC-10715) : cron exceptions are caught by Sentry
Browse files Browse the repository at this point in the history
Somehow, either apscheduler or sentry documentation has an issue
with what is expected to be captured leading to a mmissing
exception.
This can be fixed by explicitly building the exc_info when
calling Sentry.
  • Loading branch information
xordoquy committed Sep 7, 2021
1 parent 6a7d1f8 commit 2c0a70f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pcapi/scheduled_tasks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

def sentry_listener(event: cron_events.JobExecutionEvent) -> None:
if event.exception:
sentry_sdk.capture_exception(event.exception)
exc_info = type(event.exception), event.exception, event.exception.__traceback__
sentry_sdk.capture_exception(exc_info)


def activate_sentry(scheduler: base_schedulers.BaseScheduler) -> None:
Expand Down

0 comments on commit 2c0a70f

Please sign in to comment.