module Network.HTTP.Encoding.Error (EncodingError (..)
,ConversionError (..)) where
import Codec.Text.IConv (ConversionError
,reportConversionError)
data EncodingError = CannotDetermineCharacterEncoding
| UnsupportedCompressionAlgorithm
| IConvError ConversionError
| GenericError String
instance Show EncodingError where
show err = case err of
CannotDetermineCharacterEncoding ->
"No character encoding was specified in message headers \
\and the body character encoding cannot be determined"
UnsupportedCompressionAlgorithm ->
"Sorry, the 'compress' algorithm is not supported at this time"
IConvError conv_err ->
"Charset conversion error in iconv: " ++
show (reportConversionError conv_err)
GenericError err -> "Generic error: " ++ err