kinbiko / bugsnag

Well-documented, maintainable, idiomatic, opinionated, and *unofficial* rewrite of the Bugsnag Go notifier
MIT License
3 stars 0 forks source link

[Feature Request] Make Wrap return error #31

Closed kinbiko closed 3 years ago

kinbiko commented 3 years ago

What problem are you trying to solve?

I'd like to be able to inject a notifier into a package that's agnostic of this library, without losing any functionality.

Currently this is impossible because the *Notifier#Wrap() method returns a *bugsnag.Error, and although this adheres to the error interface, the compiler won't allow an error return type.

Describe how you wish this package would help you solve the problem

The *Notifier's Wrap method should return a standard library error so that packages can interface away the Bugsnag dependency if they so wish.

The package-level Wrap function can still return a *bugsnag.Error, as by definition, there's already a dependency on the Bugsnag library at that point. This way users don't have to do any type casting if they want to access the Panic or Unhandled fields on the error.