bugsnag-haskell-0.0.4.3: Bugsnag error reporter for Haskell
Safe HaskellNone
LanguageHaskell2010

Network.Bugsnag.Settings

Description

Synopsis

Documentation

data BugsnagSettings Source #

Notifier settings

See newBugsnagSettings.

Constructors

BugsnagSettings 

Fields

  • bsApiKey :: BugsnagApiKey

    Your Integration API Key.

  • bsAppVersion :: Maybe Text

    The version of your application

    Marking bugs as Fixed and having them auto-reopen in new versions requires you set this.

  • bsReleaseStage :: BugsnagReleaseStage

    The current release-stage, Production by default

  • bsNotifyReleaseStages :: [BugsnagReleaseStage]

    Which release-stages to notify in. Only Production by default

  • bsBeforeNotify :: BeforeNotify

    Modify any events before they are sent

    For example to attach a user, or set the context.

  • bsIgnoreException :: BugsnagException -> Bool

    Exception filtering

    Functions like notifyBugsnag will do nothing with exceptions that pass this predicate. N.B. Something lower-level, like reportError won't be aware of this.

  • bsHttpManager :: Manager

    The HTTP Manager used to emit notifications

    It's more efficient, and ensures proper resource cleanup, to share a single manager across an application. Must be TLS-enabled.

  • bsCodeIndex :: Maybe CodeIndex

    A CodeIndex built at compile-time from project sources

    If set, this will be used to update StackFrames to include lines of source code context as read out of this value. N.B. using this means loading and keeping the source code for the entire project in memory.

newBugsnagSettings :: BugsnagApiKey -> IO BugsnagSettings Source #

Construct settings with a new, TLS-enabled Manager

Uses getGlobalManager.

>>> 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 -> BugsnagEvent -> Bool Source #

Should this BugsnagEvent trigger notification?

>>> settings <- newBugsnagSettings ""
>>> let event = bugsnagEvent $ bugsnagException "" "" []
>>> bugsnagShouldNotify settings event
True
>>> let devSettings = settings { bsReleaseStage = DevelopmentReleaseStage }
>>> bugsnagShouldNotify devSettings event
False
>>> bugsnagShouldNotify devSettings { bsNotifyReleaseStages = [DevelopmentReleaseStage] } event
True
>>> let ignore = (== "IgnoreMe") . beErrorClass
>>> let ignoreSettings = settings { bsIgnoreException = ignore }
>>> let ignoreEvent = bugsnagEvent $ bugsnagException "IgnoreMe" "" []
>>> bugsnagShouldNotify ignoreSettings event
True
>>> bugsnagShouldNotify ignoreSettings ignoreEvent
False