Closed bradleyfalzon closed 7 years ago
@bradleyfalzon Sorry for my lateness.
I don't use StackTraceConfiguration.Enable
feature personally.
But it's look good, so if no one oppose to it, I'll merge this.
Thanks, I'll rebase in the next couple days (not near that branch atm).
Sorry for the noise, rebased and ready for review.
@bradleyfalzon Thank you for your contribution 🥇 (and sorry for forgetting to merge this :persevere:)
Note: https://github.com/evalphobia/logrus_sentry/releases/tag/v0.4.2
Previously, when stacktrace was enabled, the culprit would be set to the first error that did not implement Cause (as detected by
errors.Cause(err)
), this had the affect of not showing any additional context added to the error.This was also inconsistent with the same behaviour when stacktrace was disabled.
This change attempts to unify that behaviour, as well as to not discard the context added to the errors.
Example program (snippet):
Current behaviour with Stacktrace enabled (notice no
could not poll %v
- we've lost the context):Current behaviour without Stacktrace enabled (we have our context):
Proposed behaviour (but this still doesn't unify the behaviour with or without stack trace):
Alternative (by removing
err := errors.Cause(err)
completely):So, I'm happier with the proposed behaviour, as I now have the context around the error again, but it's still not the same as the behaviour with or without stacktrace being enabled. Thoughts, do they need to be the same? Does this break Sentry's ability to group errors if the context changes slightly but the root cause is the same?