File tree 1 file changed +8
-6
lines changed
sentry-rails/lib/sentry/rails
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?
18
18
end
19
19
20
20
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 )
24
22
super
25
23
end
26
24
@@ -54,15 +52,19 @@ def record(job, &block)
54
52
rescue Exception => e # rubocop:disable Lint/RescueException
55
53
finish_sentry_transaction ( transaction , 500 )
56
54
57
- unless Sentry . configuration . rails . active_job_report_after_job_retries
58
- capture_exception ( job , e )
59
- end
55
+ maybe_capture_exception ( job , e )
60
56
61
57
raise
62
58
end
63
59
end
64
60
end
65
61
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
+
66
68
def capture_exception ( job , e )
67
69
Sentry ::Rails . capture_exception (
68
70
e ,
You can’t perform that action at this time.
0 commit comments