[uss_qualifier] Centralize traceback.format_exception call #427
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.
As evidenced by #367, we call
traceback.format_exception
in a number of different places in our codebase to construct a stracktrace string. Prompted by some mysterious observed exceptions, this PR makes a singlestacktrace_string
function that everywhere else in the codebase references, and that function is the only place that callsformat_exception
(this would have made #367 easier had it already existed).While trying to reproduce the issue, I also discovered misbehavior when returning a tuple from idempotent handlers so this PR fixes that issue as well.
Finally, the codebase information is printed to console to help debug problems like this in the future.
Observed logs, lightly redacted: