packages feed

bugsnag-types-1.1.0.0: src/Data/Bugsnag/Types/SeverityReasonType.hs

module Data.Bugsnag.Types.SeverityReasonType
  ( SeverityReasonType (..)
  , exampleSeverityReasonType
  ) where

import Data.Bugsnag.Types.Prelude


data SeverityReasonType
  = UnhandledException
  -- ^ Whenever an uncaught exception is discovered (generic).
  | UnhandledError
  -- ^ When an error is discovered (PHP).
  | Log
  -- ^ Whenever a log message is sent (generic).
  | Signal
  -- ^ Whenever a "fatal" signal is discovered (iOS).
  | StrictMode
  -- ^ Whenever a strictMode issue is discovered (Android).
  | UnhandledPromiseRejection
  -- ^ Whenever an unhandled promise rejection is discovered (JS/Node JS/React Native).
  | CallbackErrorIntercept
  -- ^ callbackErrorIntercept (Node JS).
  | ErrorClass
  -- ^ Whenever an exception with a particular class is automatically sent (Ruby).
  | ExceptionClass
  -- ^ Whenever an exception with a particular class is automatically sent (Java).
  | UnhandledPanic
  -- ^ When a panic is unhandled and crashes the app (Go).
  | UnhandledErrorMiddleware
  -- ^ Unhandled errors in ${Negroni} middleware have a default severity:error.
  | UnhandledExceptionMiddleware
  -- ^ Unhandled exceptions in ${Rack} middleware have a default severity:error.
  | UserCallbackSetSeverity
  -- ^ Whenever a callback changes a report's severity (generic).
  | UserSpecifiedSeverity
  -- ^ Whenever a severity is set through a manual notify call (generic).
  | HandledException
  -- ^ Whenever a handled exception is sent through (generic).
  | HandledError
  -- ^ Whenever a handled error is sent through (PHP).
  | HandledPanic
  -- ^ Whenever a panic is handled through AutoNotify or Recover (Go).
  | UserContextSetSeverity
  -- ^ When a user creates a context which changes the severity (Python).
  | AnrError
  -- ^ Whenever an ANR is detected (Android).
  | AppHang
  -- ^ Whenever an app hang is detected (Cocoa).
  | OutOfMemory
  -- ^ When an app is terminated because it used too much memory (Cocoa).
  | ThermalKill
  -- ^ When an app is terminated because the device is overheating (Cocoa).
  deriving stock (Bounded, Enum, Eq, Show, Generic)

instance FromJSON SeverityReasonType where
  parseJSON = genericParseJSON aesonOptions

instance ToJSON SeverityReasonType where
  toJSON = genericToJSON aesonOptions
  toEncoding = genericToEncoding aesonOptions

exampleSeverityReasonType :: SeverityReasonType
exampleSeverityReasonType = toEnum 0