message-forwrding: keep backtraces when reraising an exception (26.1-lcm)#6996
Merged
psafont merged 1 commit intoxapi-project:26.1-lcmfrom Apr 15, 2026
Merged
Conversation
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. Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech> (cherry picked from commit 1268943)
lindig
approved these changes
Apr 9, 2026
robhoes
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Backtrace.reraise e e: this is more expensive than it needs tobe.
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.
(cherry picked from commit
1268943)