Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve ex-data of all ex-info exceptions in the cause chain #61

Merged

Conversation

DerGuteMoritz
Copy link
Contributor

@DerGuteMoritz DerGuteMoritz commented Nov 3, 2023

Instead of only adding ex-data of the top-level exception into the extra map, walk down the cause chain and add all ex-data encountered therein. To prevent them from clobbering each other or any keys already present in the extra map, nest all ex-data under separate keys. The top-level exception's ex-data is added under "ex-data" while causes are added under "ex-data, cause <n>: <message>" where <n> is the cause's position in the chain and <message> is its message.

Instead of only adding ex-data of the top-level exception into the extra map, walk down the cause
chain and add all ex-data encountered therein. To prevent them from clobbering each other or any
keys already present in the extra map, nest all ex-data under separate keys. The top-level
exception's ex-data is added under "ex-data" while causes are added under "ex-data, cause <n>:
<message>" where `<n>` is the cause's position in the chain and `<message>` is its message.
@bruno-garcia
Copy link
Member

I'll leave this one up to @dharrigan who has been maintaining this for years

@bruno-garcia bruno-garcia removed their request for review November 6, 2023 15:09
@dharrigan dharrigan merged commit 3f97775 into getsentry:master Nov 7, 2023
@dharrigan
Copy link
Collaborator

Looks great! Thank you @DerGuteMoritz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants