honeybadger-io / honeybadger-go

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

Flush notices on panic fixes #27 #29

Closed sypher7 closed 6 years ago

sypher7 commented 6 years ago

Problem

Documentation suggests capturing unhandled panics as such:

func main() {
  defer honeybadger.Monitor()
  // ... Exploding code here ...
}

However, the Monitor() function will often re-raise the panic's error and exit the application before it can be sent by the backend, since that happens asynchronously.

Solution

Force notices to Flush() before re-raising.

joshuap commented 6 years ago

@sypher7 thanks, this looks good to me!