{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DerivingStrategies #-}
module Http.Exchange.Types
( HttpException (..)
) where
import Control.Exception qualified as E
import Data.Bytes (Bytes)
data HttpException
= ChunkTooLarge
| ChunkedBodyEndOfInput
| NonchunkedBodyEndOfInput
| ContentLengthDuplicated
| ContentLengthMalformed
| ContentLengthTooLarge
| ExpectedCrlfAfterChunk
| ExpectedCrlfAfterChunkLength
| ExpectedCrlfBeforeChunkLength
|
|
{-# UNPACK #-} !Bytes
|
|
ImplementationMistake
| NonNumericChunkLength
| PipelinedResponses
| TransferEncodingUnrecognized
| TransferEncodingDuplicated
deriving anyclass (Show HttpException
Typeable HttpException
(Typeable HttpException, Show HttpException) =>
(HttpException -> SomeException)
-> (SomeException -> Maybe HttpException)
-> (HttpException -> String)
-> Exception HttpException
SomeException -> Maybe HttpException
HttpException -> String
HttpException -> SomeException
forall e.
(Typeable e, Show e) =>
(e -> SomeException)
-> (SomeException -> Maybe e) -> (e -> String) -> Exception e
$ctoException :: HttpException -> SomeException
toException :: HttpException -> SomeException
$cfromException :: SomeException -> Maybe HttpException
fromException :: SomeException -> Maybe HttpException
$cdisplayException :: HttpException -> String
displayException :: HttpException -> String
E.Exception)
instance Show HttpException where
showsPrec :: Int -> HttpException -> ShowS
showsPrec Int
_ HttpException
ChunkTooLarge = String -> ShowS
showString String
"ChunkTooLarge"
showsPrec Int
_ HttpException
ChunkedBodyEndOfInput = String -> ShowS
showString String
"ChunkedBodyEndOfInput"
showsPrec Int
_ HttpException
NonchunkedBodyEndOfInput = String -> ShowS
showString String
"NonchunkedBodyEndOfInput"
showsPrec Int
_ HttpException
ContentLengthDuplicated = String -> ShowS
showString String
"ContentLengthDuplicated"
showsPrec Int
_ HttpException
ContentLengthMalformed = String -> ShowS
showString String
"ContentLengthMalformed"
showsPrec Int
_ HttpException
ContentLengthTooLarge = String -> ShowS
showString String
"ContentLengthTooLarge"
showsPrec Int
_ HttpException
ExpectedCrlfAfterChunk = String -> ShowS
showString String
"ExpectedCrlfAfterChunk"
showsPrec Int
_ HttpException
ExpectedCrlfAfterChunkLength = String -> ShowS
showString String
"ExpectedCrlfAfterChunkLength"
showsPrec Int
_ HttpException
ExpectedCrlfBeforeChunkLength = String -> ShowS
showString String
"ExpectedCrlfBeforeChunkLength"
showsPrec Int
_ HttpException
HeadersMalformed = String -> ShowS
showString String
"HeadersMalformed"
showsPrec Int
_ HeadersEndOfInput {} = String -> ShowS
showString String
"HeadersEndOfInput{..}"
showsPrec Int
_ HttpException
HeadersTooLarge = String -> ShowS
showString String
"HeadersTooLarge"
showsPrec Int
_ HttpException
ImplementationMistake = String -> ShowS
showString String
"ImplementationMistake"
showsPrec Int
_ HttpException
NonNumericChunkLength = String -> ShowS
showString String
"NonNumericChunkLength"
showsPrec Int
_ HttpException
PipelinedResponses = String -> ShowS
showString String
"PipelinedResponses"
showsPrec Int
_ HttpException
TransferEncodingUnrecognized = String -> ShowS
showString String
"TransferEncodingUnrecognized"
showsPrec Int
_ HttpException
TransferEncodingDuplicated = String -> ShowS
showString String
"TransferEncodingDuplicated"