Commit b5e9a3a
authored
message-forwrding: keep backtraces when reraising an exception (#6995)
A few functions in message_forwarding need to do some cleanup when
encountering an exception, but in doing so, the original backtrace is
lost. This makes it difficult to track down the original location that
raised
the exception.
I've considered other options instead of calling Backtrace.is_important:
- Call `Backtrace.reraise e e`: this is more expensive than it needs to
be.
- Create a new function that can be easily used: This is awkward to
backport, and in my attempts the resulting code was not great to read.
So I ended up with the compromise of using Backtrace.is_important, which
does exactly what's needed here, even though it's difficult to enforce
correctly across the codebase.1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
332 | 333 | | |
333 | 334 | | |
334 | 335 | | |
335 | | - | |
| 336 | + | |
336 | 337 | | |
337 | 338 | | |
| 339 | + | |
338 | 340 | | |
339 | 341 | | |
340 | 342 | | |
| |||
346 | 348 | | |
347 | 349 | | |
348 | 350 | | |
349 | | - | |
350 | | - | |
| 351 | + | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| |||
1311 | 1312 | | |
1312 | 1313 | | |
1313 | 1314 | | |
| 1315 | + | |
1314 | 1316 | | |
1315 | 1317 | | |
1316 | 1318 | | |
| |||
1492 | 1494 | | |
1493 | 1495 | | |
1494 | 1496 | | |
| 1497 | + | |
1495 | 1498 | | |
1496 | 1499 | | |
1497 | 1500 | | |
| |||
1636 | 1639 | | |
1637 | 1640 | | |
1638 | 1641 | | |
| 1642 | + | |
1639 | 1643 | | |
1640 | 1644 | | |
1641 | 1645 | | |
| |||
5215 | 5219 | | |
5216 | 5220 | | |
5217 | 5221 | | |
| 5222 | + | |
5218 | 5223 | | |
5219 | 5224 | | |
5220 | 5225 | | |
| |||
6564 | 6569 | | |
6565 | 6570 | | |
6566 | 6571 | | |
| 6572 | + | |
6567 | 6573 | | |
6568 | 6574 | | |
6569 | 6575 | | |
| |||
0 commit comments