technoweenie/grohl — pull request #18 by technoweenie (2014-08-11 18:39:21+00:00)
Title: Error wrapping

Trying to answer my own question from #17.

* Wrap an error with a user-visible error message.
* Add the stack from `runtime.Stack()` at the time the error was created, not [when it's reported](https://github.com/technoweenie/grohl/blob/2bcb53d3f65b2ecb54612869abec02823316c77a/errors.go#L41). I find this gives more accurate stack traces.
* For web applications, track the HTTP status code to return.
* Errors can return `false` for Reportable(). This way errors can be used for user-visible error messages without being sent to the error reporter.
* Errors can have their own grohl context.

I didn't go with the `errgo` package because it doesn't seem to track the stack trace. Stack traces are really useful for our high level app code.

Also, this `*grohl.Error` type is not required by grohl at all. Pass in your own errors, and implement the interfaces that make sense to your use case.