MIT licensed by Patrick Brisbin
Maintained by [email protected]
This version can be pinned in stack with:bugsnag-haskell-0.0.2.2@sha256:1f97c1064f2f0303004a2822b350d79cc81996043a08f83f328423f42ccc8d8d,3865

Module documentation for 0.0.2.2

  • Data
    • Data.Aeson
      • Data.Aeson.Ext
  • Network
    • Network.Bugsnag
      • Network.Bugsnag.App
      • Network.Bugsnag.BeforeNotify
      • Network.Bugsnag.Breadcrumb
      • Network.Bugsnag.CodeIndex
      • Network.Bugsnag.Device
      • Network.Bugsnag.Event
      • Network.Bugsnag.Exception
        • Network.Bugsnag.Exception.Parse
      • Network.Bugsnag.Notifier
      • Network.Bugsnag.Notify
      • Network.Bugsnag.ReleaseStage
      • Network.Bugsnag.Report
      • Network.Bugsnag.Reporter
      • Network.Bugsnag.Request
      • Network.Bugsnag.Session
      • Network.Bugsnag.Settings
      • Network.Bugsnag.Severity
      • Network.Bugsnag.StackFrame
      • Network.Bugsnag.Thread
      • Network.Bugsnag.User

Bugsnag error reporter for Haskell

Catch and report exceptions in your Haskell code.

Configuration

settings <- newBugsnagSettings "BUGSNAG_API_KEY"

See Network.Bugsnag.Settings.

Reporting an Error

notifyBugsnag settings $ toException
    $ bugsnagException "Error" "message"
        [ $(currentStackFrame) "myFunction"
        ]

See Network.Bugsnag.Notify.

Throwing & Catching

Throw a BugsnagException yourself:

throw
    $ bugsnagException "Error" "message" [$(currentStackFrame) "myFunction"]

Catch any exceptions, notify, and re-throw it:

myFunction `catch` \ex -> do
    notifyBugsnag settings ex
    throw ex

Examples

Examples can be built locally with:

stack build --flag bugsnag-haskell:examples

Contributing

See CONTRIBUTING.


CHANGELOG | LICENSE

Changes

Unreleased

None

v0.0.2.1

  • Set StackFrame as in-project based on the CodeIndex when present
  • Correctly parse throwString exceptions with newlines in the message

v0.0.2.0

  • Add CodeIndex support

    Adds a Template Haskell function to read your project source into an in-memory Map structure to be set on your BugsnagSettings value. Then, as part of notification, we can attach lines of source context to the StackFrames we have. NOTE: This has memory-footprint implications, so is entirely opt-in.

    See https://github.com/pbrisbin/bugsnag-haskell/pull/39

v0.0.1.3

  • Redact sensitive request headers by default #31
  • Deprecate Settings that should be BeforeNotify values #32
  • bugsnagShouldNotify operates after any BeforeNotify changes

v0.0.1.2

  • Make App Version an opaque Text, not a structured Version (@MaxGabriel)

v0.0.1.1

First (pre-) released version.