bugsnag-haskell-0.0.1.1: Bugsnag error reporter for Haskell

Safe HaskellNone
LanguageHaskell2010

Network.Bugsnag.BeforeNotify

Contents

Synopsis

Documentation

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 @SqlError ex of
    Just SqlError{..} -> ex
        { beErrorClass = "SqlError-" <> sqlErrorCode
        , beMessage = sqlErrorMessage
        }

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