Closed vendion closed 3 years ago
Thanks for the suggestion @vendion. The Notify
func is intentionally not returning anything since it is intended to be used as an async function.
The Notifier
struct ultimately wraps the provided error as a Notice
. If Notifier.Notify
was refactored to return something, it would make more sense for us to return a Notice
rather than the first arg provided to the Notify
func. However, that could be achieved using the following:
notice := airbrake.Notice(errors.New(`something went wrong`), nil, 1)
log.Error(notice)
airbrake.SendNoticeAsync(notice)
It's not a one-liner, but it's possible.
It would be nice if
*Notifier.Notify
also returns what get passed in as the first argument.This would allow for a bit of streamlining something like the following