-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Bugsnag error reporter for Haskell
--   
--   Please see README.md
@package bugsnag-haskell
@version 0.0.3.0


-- | Orphan instances and shared <tt><tt>Generic</tt></tt> JSON options.
module Data.Aeson.Ext

-- | Our custom Aeson <tt><a>Options</a></tt>
--   
--   Omits <tt><a>Nothing</a></tt> fields, and drops/lowers accordingly:
--   
--   <pre>
--   &gt;&gt;&gt; fieldLabelModifier (bsAesonOptions "bs") "bsReleaseStage"
--   "releaseStage"
--   </pre>
--   
--   For sums, the first argument is taken as a suffix:
--   
--   <pre>
--   &gt;&gt;&gt; constructorTagModifier (bsAesonOptions "ReasonType") "UnhandledExceptionReasonType"
--   "unhandledException"
--   </pre>
bsAesonOptions :: String -> Options
instance Data.Aeson.Types.ToJSON.ToJSON Data.ByteString.Internal.ByteString
instance Data.Aeson.Types.ToJSON.ToJSON a => Data.Aeson.Types.ToJSON.ToJSON (Data.CaseInsensitive.Internal.CI a)

module Network.Bugsnag.Breadcrumb
data BugsnagBreadcrumbType
NavigationBreadcrumb :: BugsnagBreadcrumbType
RequestBreadcrumb :: BugsnagBreadcrumbType
ProcessBreadcrumb :: BugsnagBreadcrumbType
LogBreadcrumb :: BugsnagBreadcrumbType
UserBreadcrumb :: BugsnagBreadcrumbType
StateBreadcrumb :: BugsnagBreadcrumbType
ErrorBreadcrumb :: BugsnagBreadcrumbType
ManualBreadcrumb :: BugsnagBreadcrumbType
data BugsnagBreadcrumb
BugsnagBreadcrumb :: UTCTime -> Text -> BugsnagBreadcrumbType -> Maybe Value -> BugsnagBreadcrumb
[bbTimestamp] :: BugsnagBreadcrumb -> UTCTime
[bbName] :: BugsnagBreadcrumb -> Text
[bbType] :: BugsnagBreadcrumb -> BugsnagBreadcrumbType
[bbMetaData] :: BugsnagBreadcrumb -> Maybe Value
bugsnagBreadcrumb :: UTCTime -> Text -> BugsnagBreadcrumbType -> BugsnagBreadcrumb
instance GHC.Generics.Generic Network.Bugsnag.Breadcrumb.BugsnagBreadcrumb
instance GHC.Generics.Generic Network.Bugsnag.Breadcrumb.BugsnagBreadcrumbType
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Breadcrumb.BugsnagBreadcrumb
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Breadcrumb.BugsnagBreadcrumbType

module Network.Bugsnag.CodeIndex
data CodeIndex
buildCodeIndex :: String -> Q Exp
findSourceRange :: FilePath -> (Natural, Natural) -> CodeIndex -> Maybe [(Natural, Text)]
instance GHC.Show.Show Network.Bugsnag.CodeIndex.CodeIndex
instance Language.Haskell.TH.Syntax.Lift Network.Bugsnag.CodeIndex.CodeIndex
instance GHC.Show.Show Network.Bugsnag.CodeIndex.FileIndex
instance Language.Haskell.TH.Syntax.Lift Network.Bugsnag.CodeIndex.FileIndex

module Network.Bugsnag.Device
newtype Bytes
Bytes :: Natural -> Bytes
data BugsnagDevice
BugsnagDevice :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Version -> Maybe Bytes -> Maybe Bytes -> Maybe Bytes -> Maybe Text -> Maybe Version -> Maybe Bool -> Maybe Text -> BugsnagDevice
[bdHostname] :: BugsnagDevice -> Maybe Text
[bdId] :: BugsnagDevice -> Maybe Text
[bdManufacturer] :: BugsnagDevice -> Maybe Text
[bdModel] :: BugsnagDevice -> Maybe Text
[bdModelNumber] :: BugsnagDevice -> Maybe Text
[bdOsName] :: BugsnagDevice -> Maybe Text
[bdOsVersion] :: BugsnagDevice -> Maybe Version
[bdFreeMemory] :: BugsnagDevice -> Maybe Bytes
[bdTotalMemory] :: BugsnagDevice -> Maybe Bytes
[bdFreeDisk] :: BugsnagDevice -> Maybe Bytes
[bdBrowserName] :: BugsnagDevice -> Maybe Text
[bdBrowserVersion] :: BugsnagDevice -> Maybe Version
[bdJailBroken] :: BugsnagDevice -> Maybe Bool
[bdOrientation] :: BugsnagDevice -> Maybe Text
bugsnagDevice :: BugsnagDevice

-- | <i>Attempt</i> to divine a <tt><a>BugsnagDevice</a></tt> from a
--   request's User Agent
bugsnagDeviceFromWaiRequest :: Request -> Maybe BugsnagDevice
instance GHC.Generics.Generic Network.Bugsnag.Device.BugsnagDevice
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Device.Bytes
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Device.BugsnagDevice

module Network.Bugsnag.ReleaseStage
data BugsnagReleaseStage
DevelopmentReleaseStage :: BugsnagReleaseStage
StagingReleaseStage :: BugsnagReleaseStage
ProductionReleaseStage :: BugsnagReleaseStage
CustomReleaseStage :: Text -> BugsnagReleaseStage
instance GHC.Show.Show Network.Bugsnag.ReleaseStage.BugsnagReleaseStage
instance GHC.Classes.Eq Network.Bugsnag.ReleaseStage.BugsnagReleaseStage
instance Data.Aeson.Types.FromJSON.FromJSON Network.Bugsnag.ReleaseStage.BugsnagReleaseStage
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.ReleaseStage.BugsnagReleaseStage

module Network.Bugsnag.App
data BugsnagApp
BugsnagApp :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe BugsnagReleaseStage -> Maybe Text -> Maybe [Text] -> Maybe Natural -> Maybe Natural -> Maybe Bool -> BugsnagApp
[baId] :: BugsnagApp -> Maybe Text
[baVersion] :: BugsnagApp -> Maybe Text
[baBuildUUID] :: BugsnagApp -> Maybe Text
[baReleaseStage] :: BugsnagApp -> Maybe BugsnagReleaseStage
[baType] :: BugsnagApp -> Maybe Text
[baDsymUUIDs] :: BugsnagApp -> Maybe [Text]
[baDuration] :: BugsnagApp -> Maybe Natural
[baDurationInForeground] :: BugsnagApp -> Maybe Natural
[baInForeground] :: BugsnagApp -> Maybe Bool
bugsnagApp :: BugsnagApp
instance GHC.Generics.Generic Network.Bugsnag.App.BugsnagApp
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.App.BugsnagApp

module Network.Bugsnag.Request

-- | The web request being handled when the error was encountered
data BugsnagRequest
BugsnagRequest :: Maybe ByteString -> Maybe RequestHeaders -> Maybe Method -> Maybe ByteString -> Maybe ByteString -> BugsnagRequest
[brClientIp] :: BugsnagRequest -> Maybe ByteString
[brHeaders] :: BugsnagRequest -> Maybe RequestHeaders
[brHttpMethod] :: BugsnagRequest -> Maybe Method
[brUrl] :: BugsnagRequest -> Maybe ByteString
[brReferer] :: BugsnagRequest -> Maybe ByteString

-- | Constructs an empty <tt><a>BugsnagRequest</a></tt>
bugsnagRequest :: BugsnagRequest

-- | Constructs a <tt><a>BugsnagRequest</a></tt> from a WAI
--   <tt><a>Request</a></tt>
bugsnagRequestFromWaiRequest :: Request -> BugsnagRequest
instance GHC.Generics.Generic Network.Bugsnag.Request.BugsnagRequest
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Request.BugsnagRequest

module Network.Bugsnag.Severity
data BugsnagSeverity
ErrorSeverity :: BugsnagSeverity
WarningSeverity :: BugsnagSeverity
InfoSeverity :: BugsnagSeverity
data BugsnagSeverityReason
BugsnagSeverityReason :: BugsnagSeverityReasonType -> BugsnagSeverityReasonAttributes -> BugsnagSeverityReason
[bsrType] :: BugsnagSeverityReason -> BugsnagSeverityReasonType
[bsrAttributes] :: BugsnagSeverityReason -> BugsnagSeverityReasonAttributes
data BugsnagSeverityReasonAttributes
BugsnagSeverityReasonAttributes :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> BugsnagSeverityReasonAttributes
[bsraErrorType] :: BugsnagSeverityReasonAttributes -> Maybe Text
[bsraLevel] :: BugsnagSeverityReasonAttributes -> Maybe Text
[bsraSignalType] :: BugsnagSeverityReasonAttributes -> Maybe Text
[bsraViolationType] :: BugsnagSeverityReasonAttributes -> Maybe Text
[bsraErrorClass] :: BugsnagSeverityReasonAttributes -> Maybe Text
bugsnagSeverityReasonAttributes :: BugsnagSeverityReasonAttributes
data BugsnagSeverityReasonType
UnhandledExceptionReasonType :: BugsnagSeverityReasonType
UnhandledErrorReasonType :: BugsnagSeverityReasonType
LogReasonType :: BugsnagSeverityReasonType
SignalReasonType :: BugsnagSeverityReasonType
StrictModeReasonType :: BugsnagSeverityReasonType
UnhandledPromiseRejectionReasonType :: BugsnagSeverityReasonType
CallbackErrorInterceptReasonType :: BugsnagSeverityReasonType
ErrorClassReasonType :: BugsnagSeverityReasonType
UnhandledPanicReasonType :: BugsnagSeverityReasonType
UserCallbackSetSeverityReasonType :: BugsnagSeverityReasonType
UserSpecifiedSeverityReasonType :: BugsnagSeverityReasonType
HandledExceptionReasonType :: BugsnagSeverityReasonType
HandledErrorReasonType :: BugsnagSeverityReasonType
HandledPanicReasonType :: BugsnagSeverityReasonType
UserContextSetSeverityReasonType :: BugsnagSeverityReasonType
instance GHC.Generics.Generic Network.Bugsnag.Severity.BugsnagSeverityReason
instance GHC.Generics.Generic Network.Bugsnag.Severity.BugsnagSeverityReasonAttributes
instance GHC.Generics.Generic Network.Bugsnag.Severity.BugsnagSeverityReasonType
instance GHC.Generics.Generic Network.Bugsnag.Severity.BugsnagSeverity
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Severity.BugsnagSeverityReason
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Severity.BugsnagSeverityReasonAttributes
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Severity.BugsnagSeverityReasonType
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Severity.BugsnagSeverity

module Network.Bugsnag.StackFrame

-- | Lines of code surrounding the error
--   
--   Pairs of <tt>(line-number, line-of-code)</tt>, up to 3 on either side.
newtype BugsnagCode
BugsnagCode :: [(Natural, Text)] -> BugsnagCode

-- | Attempt to attach a <tt><a>BugsnagCode</a></tt> to a
--   <tt><a>BugsnagStackFrame</a></tt>
--   
--   Looks up the content in the Index by File/LineNumber and, if found,
--   sets it on the record.
attachBugsnagCode :: CodeIndex -> BugsnagStackFrame -> BugsnagStackFrame
data BugsnagStackFrame
BugsnagStackFrame :: FilePath -> Natural -> Maybe Natural -> Text -> Maybe Bool -> Maybe BugsnagCode -> BugsnagStackFrame
[bsfFile] :: BugsnagStackFrame -> FilePath
[bsfLineNumber] :: BugsnagStackFrame -> Natural
[bsfColumnNumber] :: BugsnagStackFrame -> Maybe Natural

-- | Function, in our parlance
[bsfMethod] :: BugsnagStackFrame -> Text
[bsfInProject] :: BugsnagStackFrame -> Maybe Bool
[bsfCode] :: BugsnagStackFrame -> Maybe BugsnagCode
bugsnagStackFrame :: FilePath -> Natural -> Text -> BugsnagStackFrame

-- | Construct a <tt><a>BugsnagStackFrame</a></tt> from the point of this
--   splice
--   
--   Unfortunately there's no way to know the function, so that must be
--   given:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XOverloadedStrings -XTemplateHaskell
--   
--   &gt;&gt;&gt; :m +Control.Arrow
--   
--   &gt;&gt;&gt; (bsfFile &amp;&amp;&amp; bsfMethod) $ $(currentStackFrame) "myFunc"
--   ("&lt;interactive&gt;","myFunc")
--   </pre>
currentStackFrame :: Q Exp
instance GHC.Show.Show Network.Bugsnag.StackFrame.BugsnagStackFrame
instance GHC.Generics.Generic Network.Bugsnag.StackFrame.BugsnagStackFrame
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.StackFrame.BugsnagCode
instance GHC.Show.Show Network.Bugsnag.StackFrame.BugsnagCode
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.StackFrame.BugsnagStackFrame


-- | Parse error messages for <tt><tt>HasCallStack</tt></tt> information.
module Network.Bugsnag.Exception.Parse
data MessageWithStackFrames
MessageWithStackFrames :: Text -> [BugsnagStackFrame] -> MessageWithStackFrames
[mwsfMessage] :: MessageWithStackFrames -> Text
[mwsfStackFrames] :: MessageWithStackFrames -> [BugsnagStackFrame]

-- | Parse an <tt><a>ErrorCall</a></tt> for <tt><tt>HasCallStack</tt></tt>
--   information
parseErrorCall :: ErrorCall -> Either String MessageWithStackFrames

-- | Parse a <tt><tt>StringException</tt></tt> for
--   <tt><tt>HasCallStack</tt></tt> information
--   
--   We accept this as <tt><a>SomeException</a></tt> so that this library
--   doesn't depend on any one concrete library that has
--   <tt><tt>throwString</tt></tt> (there are two right now, sigh.)
parseStringException :: SomeException -> Either String MessageWithStackFrames

module Network.Bugsnag.Exception
data BugsnagException
BugsnagException :: Text -> Maybe Text -> [BugsnagStackFrame] -> Maybe SomeException -> BugsnagException
[beErrorClass] :: BugsnagException -> Text
[beMessage] :: BugsnagException -> Maybe Text
[beStacktrace] :: BugsnagException -> [BugsnagStackFrame]
[beOriginalException] :: BugsnagException -> Maybe SomeException

-- | Construct a throwable <tt><a>BugsnagException</a></tt>
--   
--   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
--   <tt><a>currentStackFrame</a></tt>.
bugsnagException :: Text -> Text -> [BugsnagStackFrame] -> BugsnagException

-- | Construct a <tt><a>BugsnagException</a></tt> from a
--   <tt><a>SomeException</a></tt>
--   
--   <tt><a>BugsnagException</a></tt>s are left as-is, and
--   <tt><a>ErrorCall</a></tt> exceptions are parsed for
--   <tt><tt>HasCallStack</tt></tt> information to use as
--   <tt>stacktrace</tt>. Otherwise, we attempt to determine
--   <tt>errorClass</tt> and we use the <tt><a>show</a></tt>n exception as
--   <tt>message</tt>.
--   
--   <pre>
--   &gt;&gt;&gt; import Control.Arrow
--   
--   &gt;&gt;&gt; import System.IO.Error
--   
--   &gt;&gt;&gt; (beErrorClass &amp;&amp;&amp; beMessage) $ bugsnagExceptionFromSomeException $ toException $ userError "Oops"
--   ("IOException",Just "user error (Oops)")
--   </pre>
bugsnagExceptionFromSomeException :: SomeException -> BugsnagException
instance GHC.Show.Show Network.Bugsnag.Exception.BugsnagException
instance GHC.Generics.Generic Network.Bugsnag.Exception.BugsnagException
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Exception.BugsnagException
instance GHC.Exception.Type.Exception Network.Bugsnag.Exception.BugsnagException

module Network.Bugsnag.Thread
data BugsnagThread
BugsnagThread :: Maybe Text -> Maybe Text -> Maybe [BugsnagStackFrame] -> BugsnagThread
[btId] :: BugsnagThread -> Maybe Text
[btName] :: BugsnagThread -> Maybe Text
[btStacktrace] :: BugsnagThread -> Maybe [BugsnagStackFrame]
bugsnagThread :: BugsnagThread
instance GHC.Generics.Generic Network.Bugsnag.Thread.BugsnagThread
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Thread.BugsnagThread

module Network.Bugsnag.User
data BugsnagUser
BugsnagUser :: Maybe Text -> Maybe Text -> Maybe Text -> BugsnagUser
[buId] :: BugsnagUser -> Maybe Text
[buEmailAddress] :: BugsnagUser -> Maybe Text
[buUsername] :: BugsnagUser -> Maybe Text
bugsnagUser :: BugsnagUser
instance GHC.Generics.Generic Network.Bugsnag.User.BugsnagUser
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.User.BugsnagUser


-- | 
--   <a>https://docs.bugsnag.com/api/error-reporting/#per-session-settings</a>
module Network.Bugsnag.Session
data BugsnagSession
BugsnagSession :: Maybe BugsnagUser -> Maybe Text -> Maybe Value -> BugsnagSession
[bsUser] :: BugsnagSession -> Maybe BugsnagUser
[bsContext] :: BugsnagSession -> Maybe Text
[bsMetaData] :: BugsnagSession -> Maybe Value
bugsnagSession :: BugsnagSession
instance GHC.Generics.Generic Network.Bugsnag.Session.BugsnagSession
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Session.BugsnagSession

module Network.Bugsnag.Event
data BugsnagEvent
BugsnagEvent :: BugsnagException -> Maybe [BugsnagBreadcrumb] -> Maybe BugsnagRequest -> Maybe [BugsnagThread] -> Maybe Text -> Maybe Text -> Maybe Bool -> Maybe BugsnagSeverity -> Maybe BugsnagSeverityReason -> Maybe BugsnagUser -> Maybe BugsnagApp -> Maybe BugsnagDevice -> Maybe Value -> BugsnagEvent
[beException] :: BugsnagEvent -> BugsnagException
[beBreadcrumbs] :: BugsnagEvent -> Maybe [BugsnagBreadcrumb]
[beRequest] :: BugsnagEvent -> Maybe BugsnagRequest
[beThreads] :: BugsnagEvent -> Maybe [BugsnagThread]
[beContext] :: BugsnagEvent -> Maybe Text
[beGroupingHash] :: BugsnagEvent -> Maybe Text
[beUnhandled] :: BugsnagEvent -> Maybe Bool
[beSeverity] :: BugsnagEvent -> Maybe BugsnagSeverity
[beSeverityReason] :: BugsnagEvent -> Maybe BugsnagSeverityReason
[beUser] :: BugsnagEvent -> Maybe BugsnagUser
[beApp] :: BugsnagEvent -> Maybe BugsnagApp
[beDevice] :: BugsnagEvent -> Maybe BugsnagDevice
[beMetaData] :: BugsnagEvent -> Maybe Value
bugsnagEvent :: BugsnagException -> BugsnagEvent
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Event.BugsnagEvent

module Network.Bugsnag.BeforeNotify
type BeforeNotify = BugsnagEvent -> BugsnagEvent

-- | Modify just the Exception part of an Event
--   
--   This may be used to set more specific information for exception types
--   in scope in your application:
--   
--   <pre>
--   notifyBugsnagWith (updateException forSqlError) settings ex
--   
--   forSqlError :: BugsnagException -&gt; BugsnagException
--   forSqlError ex =
--       case fromException =&lt;&lt; beOriginalException ex of
--           Just SqlError{..} -&gt; ex
--               { beErrorClass = "SqlError-" &lt;&gt; sqlErrorCode
--               , beMessage = Just sqlErrorMessage
--               }
--           _ -&gt; ex
--   </pre>
updateException :: (BugsnagException -> BugsnagException) -> BeforeNotify

-- | Apply a function to each <tt><a>BugsnagStackFrame</a></tt> in the
--   Exception
updateStackFrames :: (BugsnagStackFrame -> BugsnagStackFrame) -> BeforeNotify

-- | Filter out StackFrames matching a predicate
filterStackFrames :: (BugsnagStackFrame -> Bool) -> BeforeNotify

-- | Set <tt><a>bsfCode</a></tt> using the given index
setStackFramesCode :: CodeIndex -> BeforeNotify

-- | Set <tt><tt>bsIsInProject</tt></tt> using the given predicate, applied
--   to the Filename
setStackFramesInProject :: (FilePath -> Bool) -> BeforeNotify
setStackFramesInProjectBy :: (BugsnagStackFrame -> a) -> (a -> Bool) -> BeforeNotify

-- | Set <tt><a>beGroupingHash</a></tt>
setGroupingHash :: Text -> BeforeNotify

-- | Set <tt><a>beGroupingHash</a></tt> based on the Event
setGroupingHashBy :: (BugsnagEvent -> Maybe Text) -> BeforeNotify

-- | Update the <tt><a>BugsnagEvent</a></tt> based on its
--   <tt><a>BugsnagException</a></tt>
--   
--   Use this instead of <tt><a>updateException</a></tt> if you want to do
--   other things to the Event, such as set its
--   <tt><a>beGroupingHash</a></tt> based on the Exception.
updateEventFromException :: (BugsnagException -> BeforeNotify) -> BeforeNotify

-- | Update the <tt><a>BugsnagEvent</a></tt> based on the original
--   exception
--   
--   This allows updating the Event after casting to an exception type that
--   this library doesn't know about (e.g. <tt>SqlError</tt>). Because the
--   result of your function is itself a <tt><a>BeforeNotify</a></tt>, you
--   can (and should) use other helpers:
--   
--   <pre>
--   myBeforeNotify =
--       <tt>defaultBeforeNotify</tt>
--           . <a>updateEventFromOriginalException</a> asSqlError
--           . <a>updateEventFromOriginalException</a> asHttpError
--           . -- ...
--   
--   asSqlError :: SqlError -&gt; BeforeNotify
--   asSqlError SqlError{..} =
--       <a>setGroupingHash</a> sqlErrorCode . <a>updateException</a> $ ex -&gt; ex
--           { beErrorClass = sqlErrorCode
--           , beMessage = sqlErrorMessage
--           }
--   </pre>
--   
--   If there is no original exception, or the cast fails, the event is
--   unchanged.
updateEventFromOriginalException :: Exception e => (e -> BeforeNotify) -> BeforeNotify

-- | Update the Event's Context and User from the Session
updateEventFromSession :: BugsnagSession -> BeforeNotify

-- | Set the events <tt><a>BugsnagEvent</a></tt> and
--   <tt><a>BugsnagDevice</a></tt>
--   
--   This function redacts the following Request headers:
--   
--   <ul>
--   <li>Authorization</li>
--   <li>Cookie</li>
--   <li>X-XSRF-TOKEN (CSRF token header used by Yesod)</li>
--   </ul>
--   
--   To avoid this, use
--   <tt><a>updateEventFromWaiRequestUnredacted</a></tt>.
updateEventFromWaiRequest :: Request -> BeforeNotify
updateEventFromWaiRequestUnredacted :: Request -> BeforeNotify

-- | Redact the given request headers
--   
--   Headers like <tt>Authorization</tt> may contain information you don't
--   want to report to Bugsnag.
--   
--   <pre>
--   redactRequestHeaders ["Authorization", "Cookie"]
--   </pre>
redactRequestHeaders :: [HeaderName] -> BeforeNotify

-- | Set the Event's Device
--   
--   See <tt><a>bugsnagDeviceFromWaiRequest</a></tt>
setDevice :: BugsnagDevice -> BeforeNotify

-- | Set the Event's Request
--   
--   See <tt><a>bugsnagRequestFromWaiRequest</a></tt>
setRequest :: BugsnagRequest -> BeforeNotify

-- | Set the stacktrace on the reported exception
--   
--   <pre>
--   notifyBugsnagWith (setStacktrace [$(currentStackFrame) "myFunc"]) ...
--   </pre>
setStacktrace :: [BugsnagStackFrame] -> BeforeNotify

-- | Set to <tt><a>WarningSeverity</a></tt>
setWarningSeverity :: BeforeNotify

-- | Set to <tt><a>ErrorSeverity</a></tt>
setErrorSeverity :: BeforeNotify

-- | Set to <tt><a>InfoSeverity</a></tt>
setInfoSeverity :: BeforeNotify


-- | 
--   <a>https://docs.bugsnag.com/api/error-reporting/#application-settings</a>
module Network.Bugsnag.Settings
newtype BugsnagApiKey
BugsnagApiKey :: Text -> BugsnagApiKey
[unBugsnagApiKey] :: BugsnagApiKey -> Text

-- | Notifier settings
--   
--   See <tt><a>newBugsnagSettings</a></tt>.
data BugsnagSettings
BugsnagSettings :: BugsnagApiKey -> Maybe Text -> BugsnagReleaseStage -> [BugsnagReleaseStage] -> BeforeNotify -> (BugsnagException -> Bool) -> Manager -> Maybe CodeIndex -> BugsnagSettings

-- | Your Integration API Key.
[bsApiKey] :: BugsnagSettings -> BugsnagApiKey

-- | The version of your application
--   
--   Marking bugs as Fixed and having them auto-reopen in new versions
--   requires you set this.
[bsAppVersion] :: BugsnagSettings -> Maybe Text

-- | The current release-stage, Production by default
[bsReleaseStage] :: BugsnagSettings -> BugsnagReleaseStage

-- | Which release-stages to notify in. Only Production by default
[bsNotifyReleaseStages] :: BugsnagSettings -> [BugsnagReleaseStage]

-- | Modify any events before they are sent
--   
--   For example to attach a user, or set the context.
[bsBeforeNotify] :: BugsnagSettings -> BeforeNotify

-- | Exception filtering
--   
--   Functions like <tt><tt>notifyBugsnag</tt></tt> will do nothing with
--   exceptions that pass this predicate. N.B. Something lower-level, like
--   <tt><tt>reportError</tt></tt> won't be aware of this.
[bsIgnoreException] :: BugsnagSettings -> BugsnagException -> Bool

-- | The HTTP <tt>Manager</tt> 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.
[bsHttpManager] :: BugsnagSettings -> Manager

-- | A <tt><a>CodeIndex</a></tt> 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.
[bsCodeIndex] :: BugsnagSettings -> Maybe CodeIndex

-- | Construct settings with a new, TLS-enabled <tt><a>Manager</a></tt>
--   
--   Uses <tt><a>getGlobalManager</a></tt>.
--   
--   <pre>
--   &gt;&gt;&gt; :set -XOverloadedStrings
--   
--   &gt;&gt;&gt; settings &lt;- newBugsnagSettings "API_KEY"
--   
--   &gt;&gt;&gt; bsApiKey settings
--   API_KEY
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; bsReleaseStage settings
--   ProductionReleaseStage
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; bsNotifyReleaseStages settings
--   [ProductionReleaseStage]
--   </pre>
newBugsnagSettings :: BugsnagApiKey -> IO BugsnagSettings

-- | Construct settings purely, given an existing <tt><a>Manager</a></tt>
bugsnagSettings :: BugsnagApiKey -> Manager -> BugsnagSettings

-- | Should this <tt><a>BugsnagEvent</a></tt> trigger notification?
--   
--   <pre>
--   &gt;&gt;&gt; :set -XOverloadedStrings
--   
--   &gt;&gt;&gt; settings &lt;- newBugsnagSettings ""
--   
--   &gt;&gt;&gt; let event = bugsnagEvent $ bugsnagException "" "" []
--   
--   &gt;&gt;&gt; bugsnagShouldNotify settings event
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; let devSettings = settings { bsReleaseStage = DevelopmentReleaseStage }
--   
--   &gt;&gt;&gt; bugsnagShouldNotify devSettings event
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; bugsnagShouldNotify devSettings { bsNotifyReleaseStages = [DevelopmentReleaseStage] } event
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; let ignore = (== "IgnoreMe") . beErrorClass
--   
--   &gt;&gt;&gt; let ignoreSettings = settings { bsIgnoreException = ignore }
--   
--   &gt;&gt;&gt; let ignoreEvent = bugsnagEvent $ bugsnagException "IgnoreMe" "" []
--   
--   &gt;&gt;&gt; bugsnagShouldNotify ignoreSettings event
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; bugsnagShouldNotify ignoreSettings ignoreEvent
--   False
--   </pre>
bugsnagShouldNotify :: BugsnagSettings -> BugsnagEvent -> Bool
instance Data.String.IsString Network.Bugsnag.Settings.BugsnagApiKey
instance Data.Aeson.Types.FromJSON.FromJSON Network.Bugsnag.Settings.BugsnagApiKey
instance GHC.Show.Show Network.Bugsnag.Settings.BugsnagApiKey


-- | Static values about this notifier itself.
module Network.Bugsnag.Notifier
data BugsnagNotifier
bugsnagNotifier :: BugsnagNotifier
instance GHC.Generics.Generic Network.Bugsnag.Notifier.BugsnagNotifier
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Notifier.BugsnagNotifier

module Network.Bugsnag.Report
data BugsnagReport
BugsnagReport :: BugsnagNotifier -> [BugsnagEvent] -> BugsnagReport
[brNotifier] :: BugsnagReport -> BugsnagNotifier
[brEvents] :: BugsnagReport -> [BugsnagEvent]
bugsnagReport :: [BugsnagEvent] -> BugsnagReport
instance GHC.Generics.Generic Network.Bugsnag.Report.BugsnagReport
instance Data.Aeson.Types.ToJSON.ToJSON Network.Bugsnag.Report.BugsnagReport


-- | Report an error to Bugsnag
--   
--   
--   <a>https://bugsnagerrorreportingapi.docs.apiary.io/#reference/0/notify/send-error-reports</a>
--   
--   This is the lowest level interface, where you're required to provide
--   all payload data explicitly, as well as a TLS-enabled
--   <tt><a>Manager</a></tt>
module Network.Bugsnag.Reporter
reportError :: Manager -> BugsnagApiKey -> BugsnagReport -> IO ()

module Network.Bugsnag.Notify

-- | Notify Bugsnag of a single exception
notifyBugsnag :: BugsnagSettings -> SomeException -> IO ()

-- | Notify Bugsnag of a single exception, modifying the event
--   
--   This is used to (e.g.) change severity for a specific error. Note that
--   the given function runs after any configured
--   <tt><a>bsBeforeNotify</a></tt>, or changes caused by other aspects of
--   settings (e.g. grouping hash).
notifyBugsnagWith :: BeforeNotify -> BugsnagSettings -> SomeException -> IO ()


-- | For examples, see
--   <a>https://github.com/pbrisbin/bugsnag-haskell#examples</a>.
module Network.Bugsnag
