pbrisbin / bugsnag-haskell

Bugsnag error reporter for Haskell
10 stars 7 forks source link

Notify asynchronously from exception handler #20

Closed pbrisbin closed 6 years ago

pbrisbin commented 6 years ago

I'm on the fence if I should just use forkIO...

pbrisbin commented 6 years ago

Other options:

  1. Leave everything sync and make end-users re-implement catchBugsnag to use (e.g.) forkHandler themselves

    Not a big deal, it's like 2 lines.

  2. Make every notification async by forking in reportError

    A pretty good option, the notify functions can return a handle for those that want to await it.

  3. Make bsBeforeNotify simply IO, not MonadIO

    At that point, you might as well just make it pure and re-arcitect things so any state can be passed in somehow else. Before-notify really wants to be MonadIO so you can read Handler state into the exception context.

Closing for now (i.e. going with 1).