Closed kostyantyn closed 8 years ago
Might be it's even better to remove second parameter from the public NewError
function.
For instance:
func NewError(thing interface{}) Error {
return newError(thing, 2)
}
+1. I think removing the second parameter would be good as long as there isn't a case where you would need to specify a different offset for the stack trace; we use the offset internally to remove honeybadger lines which aren't actually part of the trace. Do you want to update it?
updated PR. Please, review it again
Looks good, thanks!
When you don't send an error to honeybadger straightaway, you lose the trace. Having a public
NewError
method, you can wrap your error to get a proper trace.For instance:
In this case we won't see that error happened in function
three
.However, having an access to
NewError
we can keep the trace: