Skip to content
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

Proposal using pkg/errors to allow stack trace on unexpected errors #781

Closed
maleck13 opened this issue Sep 18, 2016 · 2 comments
Closed

Comments

@maleck13
Copy link
Contributor

Using the default error_handler middleware, I wanted to allow for printing a stack trace to the log when an unexpected error happens as it is these kind of errors that you want to know where the error occurred. I made this change locally by using github.com/pkg/errors to change NewErrorClass to use
https://godoc.org/github.com/pkg/errors#Wrap and then changed the error_handler middleware to use https://godoc.org/github.com/pkg/errors#Cause. This allowed a very simple change to the log statement to print the stack trace.
I wondered if this would be something you might like to include on master. If so I will create a PR with my changes

@maleck13 maleck13 changed the title propose using pkg/errors to allow stack trace on unexpected errors Proposal using pkg/errors to allow stack trace on unexpected errors Sep 18, 2016
@raphael
Copy link
Member

raphael commented Sep 19, 2016

That seems like a good idea to me, feel free to submit a PR and thank you!

@raphael
Copy link
Member

raphael commented Oct 5, 2016

Thanks for the PR!

@raphael raphael closed this as completed Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants