honeybadger-io / honeybadger-go

Send Go (golang) panics and errors to Honeybadger.
https://www.honeybadger.io/
MIT License
34 stars 15 forks source link

Can't access the original error in before notify. #48

Closed james-lawrence closed 2 months ago

james-lawrence commented 2 months ago

What are the steps to reproduce this issue?

honeybadger.Notice(MyErrorf("example"))

honeybadger.BeforeNotify(func(notice *honeybadger.Notice) error {
   log.Printf("%T\n", notice.Error) // is a honeybadger.Error which doesn't expose the underlying error.
   return nil
})

What happens?

before notify handlers receive a honeybadger.Notice, but the error being wrapped isn't accessible.

What were you expecting to happen?

I'd expect to be able to access the underlying cause using stdlib functions like unwrap, is, as. I'd also expect to be able to control the stack trace from error provided to the notice function.

What versions are you using?

Operating System: linux Package Version: v0.6.0 Go Version: 1.21

subzero10 commented 2 months ago

Should be fixed with v0.6.1!