-
Notifications
You must be signed in to change notification settings - Fork 25
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
Error message is discarded when embedding an error #14
Comments
@Alex-PK I'd be happy to review a PR. |
I think the best option here is for The reason why is because, in larger applications, you'll most likely have tons of different possible errors for one command/function. All these errors usually vary in criticalness. Therefore, it would be very unhelpful if all you see at a glance in Rollbar is more generic messages (the top-level log messages), such as "failed to run command x", likewise, the titles are what's in focus in notifications (emails/elsewhere). Getting an email such as "failed to run command x" is a lot more stressful than one directly specifying the underlying cause (maybe your application simply failed to connect to a 3rd party service, something you can't necessarily do anything about). Now, imo, the best of both worlds is to just format it as |
I found v0.2.0 already fixed this with rollbar custom data. https://github.com/heroku/rollrus/blob/v0.2.0/hook.go#L71 I will try on our environment first and report here |
Hi,
whenever
WithError
is used to log a message, the cause is taken from the embedded error and the logged message gets completely lost.Example:
This is what appears on rollbar:
The "outer message" does not appear anywhere.
I traced down the problem to
extractError
, which takes thecause
from theerr
field if it is present.In my opinion, if there is an
entry.Message
, that should be used ascause
, and theerr
field's cause should be logged in a separate field.I can prepare a PR if needed.
Thanks!
The text was updated successfully, but these errors were encountered: