evalphobia / logrus_sentry

sentry hook for logrus
MIT License
194 stars 78 forks source link

Empty error messages cause sentry to discard errors #52

Open mightyguava opened 7 years ago

mightyguava commented 7 years ago

We are seeing stacktraces for errors that have no error message string get discarded by sentry, with the message Discarded invalid value for parameter 'exception'.

I think it's due to https://github.com/evalphobia/logrus_sentry/pull/49. We use a custom config so SendExceptionType defaulted to false. Sentry rejects the exception if neither value nor type is set. This is the now case when an error with no error message is sent...

While creating errors with no message doesn't really make sense, it does happen (like from thirdparty libraries, and from errors generated from http requests). Not sure what the right solution here would be. Maybe either ignore the option if Error() returns empty string, or substitute some other value like "<empty message>"?