Closed belak closed 8 years ago
This is based on some code we used internally (originally based on this code), copied here: https://gist.github.com/belak/3c205bc30a12cef954f57b542abcfb54
I just realized that this won't work quite yet because all the error values are pulled out and converted to strings.
EDIT: This should be fixed.
@belak Thanks! I'll check this.
This works good! 👍
@belak Would you rebase&squash all commits into one? After that I'll merge this 🙆
Is it a problem that the tags were removed? I'm not 100% sure why it would do that.
Did you reproduce this tags problem on your environment? I don't use this feature actually, so I don't care about it. But someone might use tag feature. If the problem reproduced on others environment, I'll send inquiry to Sentry staff.
Logrus has Entry.WithError and an ErrorKey which provides a common place to store errors for logging. This pulls errors out and sends them as an Exception if stack traces are enabled.
It also sets the culprit to the error message (since it's the least intrusive), though my personal preference would be to take the message in the logrus entry, store that as the culprit and place the error message in the outgoing packet message. This still misses a little something, because the culprit from the Stacktrace isn't used, but it doesn't ignore the original message and puts the error message in a more useful location.