bugsnag-haskell- Bugsnag error reporter for Haskell

Safe HaskellNone





Modifying the Exception

updateException :: (BugsnagException -> BugsnagException) -> BeforeNotify Source #

Modify just the Exception part of an Event

Technically this will modify all exceptions in the Event, but if you're using this library normally, there will be only one.

This may be used to set more specific information for exception types in scope in your application:

notifyBugsnagWith (updateException forSqlError) settings ex

forSqlError :: BugsnagException -> BugsnagException
forSqlError ex =
    case fromException =<< beOriginalException ex of
        Just SqlError{..} -> ex
            { beErrorClass = "SqlError-" <> sqlErrorCode
            , beMessage = Just sqlErrorMessage
        _ -> ex

Modifying the Event

updateEventFromSession :: BugsnagSession -> BeforeNotify Source #

Update the Event's Context and User from the Session

Simple setters

setStacktrace :: [BugsnagStackFrame] -> BeforeNotify Source #

Set the stacktrace on the reported exception

notifyBugsnagWith (setStacktrace [$(currentStackFrame) "myFunc"]) ...

Setting severity