Commit 9303b9a
authored
Use prepended method instead of around_perform for ActiveJob integration (#1631)
* use prepended method instead of around_perform for activejob integration
since the sdk registers its around_perform as the "first" callback, it
needs to call all error handlers manually (which naturally should happen
later) to see if it should report the exception.
usually, this approach works well because if an exception will be
handled later, handling it ealier doesn't make much of a difference.
however, as described in #956, if there's another exception happened
inside one of the error handlers, it'll re-enter the error handler again
in here: https://github.com/rails/rails/blob/38cb5610b1/activejob/lib/active_job/execution.rb#l50-l51
Of course, it may be possible to handle such case by adding more rescue
block inside the `capture_and_reraise_with_sentry` method. But it'll
force the entire exception handling flow to be performed inside the
first `around_perform` block. And that's something we should avoid.
* Refactor ActiveJob integration
* Fix SendEventJob's rescue_from callback
* Update changelog1 parent 27da65b commit 9303b9a
File tree
4 files changed
+61
-35
lines changed- sentry-rails
- app/jobs/sentry
- lib/sentry/rails
- spec/sentry/rails
4 files changed
+61
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
1 | 8 | | |
2 | 9 | | |
3 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
17 | 11 | | |
18 | 12 | | |
19 | 13 | | |
20 | 14 | | |
21 | 15 | | |
22 | | - | |
23 | | - | |
| 16 | + | |
| 17 | + | |
24 | 18 | | |
25 | | - | |
| 19 | + | |
26 | 20 | | |
27 | 21 | | |
28 | 22 | | |
| |||
32 | 26 | | |
33 | 27 | | |
34 | 28 | | |
35 | | - | |
| 29 | + | |
36 | 30 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 31 | + | |
40 | 32 | | |
41 | 33 | | |
42 | 34 | | |
43 | | - | |
| 35 | + | |
44 | 36 | | |
45 | | - | |
46 | | - | |
| 37 | + | |
| 38 | + | |
47 | 39 | | |
48 | 40 | | |
49 | 41 | | |
50 | 42 | | |
51 | 43 | | |
52 | | - | |
| 44 | + | |
53 | 45 | | |
54 | 46 | | |
55 | 47 | | |
56 | 48 | | |
57 | 49 | | |
58 | 50 | | |
59 | | - | |
60 | | - | |
| 51 | + | |
| 52 | + | |
61 | 53 | | |
62 | 54 | | |
63 | | - | |
| 55 | + | |
64 | 56 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
71 | 63 | | |
72 | 64 | | |
73 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| |||
190 | 198 | | |
191 | 199 | | |
192 | 200 | | |
| 201 | + | |
| 202 | + | |
193 | 203 | | |
194 | 204 | | |
195 | 205 | | |
196 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
197 | 224 | | |
198 | 225 | | |
199 | 226 | | |
| |||
0 commit comments