bugsnag-haskell-0.0.1.2: Bugsnag error reporter for Haskell

Safe HaskellNone
LanguageHaskell2010

Network.Bugsnag.Settings

Description

Synopsis

Documentation

data BugsnagSettings Source #

Notifier settings

See newBugsnagSettings.

Constructors

BugsnagSettings 

Fields

newBugsnagSettings :: BugsnagApiKey -> IO BugsnagSettings Source #

Construct settings with a new, TLS-enabled Manager

>>> :set -XOverloadedStrings
>>> settings <- newBugsnagSettings "API_KEY"
>>> bsApiKey settings
API_KEY
>>> bsReleaseStage settings
ProductionReleaseStage
>>> bsNotifyReleaseStages settings
[ProductionReleaseStage]

bugsnagSettings :: BugsnagApiKey -> Manager -> BugsnagSettings Source #

Construct settings purely, given an existing Manager

bugsnagShouldNotify :: BugsnagSettings -> BugsnagException -> Bool Source #

Should this BugsnagException trigger notification?

>>> :set -XOverloadedStrings
>>> settings <- newBugsnagSettings ""
>>> let exception = bugsnagException "" "" []
>>> bugsnagShouldNotify settings exception
True
>>> let devSettings = settings { bsReleaseStage = DevelopmentReleaseStage }
>>> bugsnagShouldNotify devSettings exception
False
>>> bugsnagShouldNotify devSettings { bsNotifyReleaseStages = [DevelopmentReleaseStage] } exception
True
>>> let ignore = (== "IgnoreMe") . beErrorClass
>>> let ignoreSettings = settings { bsIgnoreException = ignore }
>>> bugsnagShouldNotify ignoreSettings exception
True
>>> bugsnagShouldNotify ignoreSettings exception { beErrorClass = "IgnoreMe" }
False