commit
65d0a51d60
1 changed files with 6 additions and 1 deletions
|
@ -1,9 +1,12 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE RecordWildCards #-}
|
||||
{-# LANGUAGE DeriveDataTypeable #-}
|
||||
module Servant.Server.Internal.ServantErr where
|
||||
|
||||
import Control.Exception (Exception)
|
||||
import qualified Data.ByteString.Char8 as BS
|
||||
import qualified Data.ByteString.Lazy as LBS
|
||||
import Data.Typeable (Typeable)
|
||||
import qualified Network.HTTP.Types as HTTP
|
||||
import Network.Wai (Response, responseLBS)
|
||||
|
||||
|
@ -11,7 +14,9 @@ data ServantErr = ServantErr { errHTTPCode :: Int
|
|||
, errReasonPhrase :: String
|
||||
, errBody :: LBS.ByteString
|
||||
, errHeaders :: [HTTP.Header]
|
||||
} deriving (Show, Eq, Read)
|
||||
} deriving (Show, Eq, Read, Typeable)
|
||||
|
||||
instance Exception ServantErr
|
||||
|
||||
responseServantErr :: ServantErr -> Response
|
||||
responseServantErr ServantErr{..} = responseLBS status errHeaders errBody
|
||||
|
|
Loading…
Reference in a new issue