| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Network.Bugsnag.BeforeNotify
- type BeforeNotify = BugsnagEvent -> BugsnagEvent
- updateException :: (BugsnagException -> BugsnagException) -> BeforeNotify
- updateEventFromSession :: BugsnagSession -> BeforeNotify
- updateEventFromWaiRequest :: Request -> BeforeNotify
- setDevice :: BugsnagDevice -> BeforeNotify
- setRequest :: BugsnagRequest -> BeforeNotify
- setStacktrace :: [BugsnagStackFrame] -> BeforeNotify
- setWarningSeverity :: BeforeNotify
- setErrorSeverity :: BeforeNotify
- setInfoSeverity :: BeforeNotify
Documentation
type BeforeNotify = BugsnagEvent -> BugsnagEvent Source #
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
}
_ -> exModifying the Event
updateEventFromSession :: BugsnagSession -> BeforeNotify Source #
Update the Event's Context and User from the Session
updateEventFromWaiRequest :: Request -> BeforeNotify Source #
Set the events and BugsnagEventBugsnagDevice
Simple setters
setDevice :: BugsnagDevice -> BeforeNotify Source #
Set the Event's Device
setRequest :: BugsnagRequest -> BeforeNotify Source #
Set the Event's Request
setStacktrace :: [BugsnagStackFrame] -> BeforeNotify Source #
Set the stacktrace on the reported exception
notifyBugsnagWith (setStacktrace [$(currentStackFrame) "myFunc"]) ...
Setting severity
setWarningSeverity :: BeforeNotify Source #
Set to WarningSeverity
setErrorSeverity :: BeforeNotify Source #
Set to ErrorSeverity
setInfoSeverity :: BeforeNotify Source #
Set to InfoSeverity