File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
sentry-rails/lib/sentry/rails Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ def already_supported_by_sentry_integration?
1818 end
1919
2020 def retry_job ( error :, **opts )
21- unless Sentry . configuration . rails . active_job_report_after_job_retries
22- SentryReporter . capture_exception ( self , error )
23- end
21+ SentryReporter . maybe_capture_exception ( self , error )
2422 super
2523 end
2624
@@ -54,15 +52,19 @@ def record(job, &block)
5452 rescue Exception => e # rubocop:disable Lint/RescueException
5553 finish_sentry_transaction ( transaction , 500 )
5654
57- unless Sentry . configuration . rails . active_job_report_after_job_retries
58- capture_exception ( job , e )
59- end
55+ maybe_capture_exception ( job , e )
6056
6157 raise
6258 end
6359 end
6460 end
6561
62+ def maybe_capture_exception ( job , e )
63+ unless Sentry . configuration . rails . active_job_report_after_job_retries
64+ capture_exception ( job , e )
65+ end
66+ end
67+
6668 def capture_exception ( job , e )
6769 Sentry ::Rails . capture_exception (
6870 e ,
You can’t perform that action at this time.
0 commit comments