module Network.Pusher.Error
  ( PusherError (..),
  )
where

import Control.Exception (Exception)
import qualified Data.Text as T
import Data.Word (Word16)

data PusherError
  = -- | Received non 200 response code from Pusher.
    Non200Response
      { PusherError -> Word16
non200ResponseStatusCode :: Word16,
        PusherError -> Text
non200ResponseBody :: T.Text
      }
  | -- | Received unexpected data from Pusher.
    InvalidResponse T.Text
  deriving (Int -> PusherError -> ShowS
[PusherError] -> ShowS
PusherError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PusherError] -> ShowS
$cshowList :: [PusherError] -> ShowS
show :: PusherError -> String
$cshow :: PusherError -> String
showsPrec :: Int -> PusherError -> ShowS
$cshowsPrec :: Int -> PusherError -> ShowS
Show)

instance Exception PusherError