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

Network.Bugsnag.Exception

Synopsis

Documentation

data BugsnagException Source #

Instances

Instances details
Show BugsnagException Source # 
Instance details

Defined in Network.Bugsnag.Exception

Generic BugsnagException Source # 
Instance details

Defined in Network.Bugsnag.Exception

Associated Types

type Rep BugsnagException :: Type -> Type #

ToJSON BugsnagException Source # 
Instance details

Defined in Network.Bugsnag.Exception

Exception BugsnagException Source # 
Instance details

Defined in Network.Bugsnag.Exception

type Rep BugsnagException Source # 
Instance details

Defined in Network.Bugsnag.Exception

type Rep BugsnagException = D1 ('MetaData "BugsnagException" "Network.Bugsnag.Exception" "bugsnag-haskell-0.0.4.1-2wBPl8SEYMUGu61lEE3DvW" 'False) (C1 ('MetaCons "BugsnagException" 'PrefixI 'True) ((S1 ('MetaSel ('Just "beErrorClass") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "beMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "beStacktrace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [BugsnagStackFrame]) :*: S1 ('MetaSel ('Just "beOriginalException") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SomeException)))))

bugsnagException :: Text -> Text -> [BugsnagStackFrame] -> BugsnagException Source #

Construct a throwable BugsnagException

Note that Message is optional in the API, but we consider it required because that's just silly. To include a stack frame from the location of construction via Template Haskell, see currentStackFrame.

bugsnagExceptionFromSomeException :: SomeException -> BugsnagException Source #

Construct a BugsnagException from a SomeException

BugsnagExceptions are left as-is, and ErrorCall exceptions are parsed for HasCallStack information to use as stacktrace. Otherwise, we attempt to determine errorClass and we use displayException as message.

>>> import Control.Arrow
>>> import System.IO.Error
>>> (beErrorClass &&& beMessage) $ bugsnagExceptionFromSomeException $ toException $ userError "Oops"
("IOException",Just "user error (Oops)")