packages feed

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

module Data.Bugsnag.Types.SeverityReasonAttributes
  ( SeverityReasonAttributes (..)
  , exampleSeverityReasonAttributes
  ) where

import Data.Bugsnag.Types.Prelude


data SeverityReasonAttributes = SeverityReasonAttributes
  { errorType :: Maybe Text
  -- ^ Included for `unhandledError` severity reason. See [PHP Error
  -- Constants](http://php.net/manual/en/errorfunc.constants.php).
  , level :: Maybe Text
  -- ^ Included for `log` severity reason.
  , signalType :: Maybe Text
  -- ^ Included for `signal` severity reason. See [Signal
  -- Codes](https://en.wikipedia.org/wiki/C_signal_handling).
  , violationType :: Maybe Text
  -- ^ Included for `strictMode` severity reason. See [Strict
  -- Mode](https://developer.android.com/reference/android/os/StrictMode.html).
  , errorClass :: Maybe Text
  -- ^ Included for `errorClass` severity reason. Specifies the error class
  -- that is automatically sent.
  , framework :: Maybe Text
  -- ^ Included for middleware severity reasons, specifies the middleware
  -- that had an error.
  , exceptionClass :: Maybe Text
  -- ^ Included for `exceptionClass` severity reason. Specifies the error class
  -- that is automatically sent.
  }
  deriving stock (Eq, Show, Generic)

instance FromJSON SeverityReasonAttributes where
  parseJSON = genericParseJSON aesonOptions

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

exampleSeverityReasonAttributes :: SeverityReasonAttributes
exampleSeverityReasonAttributes = SeverityReasonAttributes
  { errorType = Just "E_ERROR"
  , level = Just "Error"
  , signalType = Just "SIGSEGV"
  , violationType = Just "NetworkOnMainThread"
  , errorClass = Just "ActiveRecord::RecordNotFound"
  , framework = Just "Rack"
  , exceptionClass = Just "TypeMismatchException"
  }