-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
Fix: SentryEvent.throwable returns the unwrapped throwable instead of the throwableMechanism #311
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marandaneto not possible to take the same approach as we did in Java and on the getter unwrap our throwable?
having two fields to get a throwable isn't ideal
I did exactly the same approach :) our internal SDK needs access to the mechanism but clients would need the unwrapped version, that's why 2 getters |
Shouldn't we reconsider this? |
we'd break literally every it's gonna be public anyway because of being used by another packages |
What would break, I don't follow? For the internal API we can have another getter (package internal) that we can use to get the wrapper exception How would we even document:
|
getsentry/sentry-java#1201 |
Not sure it's worth increasing the public API surface in the expense of potential more confusion just to avoid a breaking change without at least putting some thought into it. Could we please consider simply returning the unwrapped Throwable and having an internal API instead for the internal behavior? Should we be using We can bump a major if that's needed. Regarding the name: why 'originThrowable"? Is it the "original throwable"? What about "sourceThrowable" I'm not sure any of these names are much better given we already have |
let's keep the discussion in a single PR, right now it's spread across a few others. |
Codecov Report
@@ Coverage Diff @@
## main #311 +/- ##
==========================================
+ Coverage 86.63% 87.39% +0.75%
==========================================
Files 52 47 -5
Lines 1751 1531 -220
==========================================
- Hits 1517 1338 -179
+ Misses 234 193 -41 Continue to review full report at Codecov.
|
…rt into fix/origin-throwable
btw looks like JS use hints for this https://docs.sentry.io/platforms/javascript/configuration/filtering/#using-hints similar to https://forum.sentry.io/t/capture-sentry-error/12811 |
Yes on other SDKs is all about hints. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM
📜 Description
Fix: SentryEvent.throwable returns the unwrapped throwable instead of the throwableMechanism
💡 Motivation and Context
#304
💚 How did you test it?
📝 Checklist
🔮 Next steps