@@ -29,7 +29,7 @@ module Servant.ClientSpec where
2929import Control.Arrow (left)
3030import Control.Concurrent (forkIO, killThread, ThreadId)
3131import Control.Exception (bracket)
32−import Control.Monad.Trans.Except (throwE )
32+import Control.Monad.Error.Class (throwError )
3333import Data.Aeson
3434import qualified Data.ByteString.Lazy as BS
3535import Data.Char (chr, isPrint)
@@ -150,8 +150,8 @@ server = serve api (
150150 :<|> return
151151 :<|> (\ name -> case name of
152152 Just "alice" -> return alice
153− Just n -> throwE $ ServantErr 400 (n ++ " not found") "" []
154− Nothing -> throwE $ ServantErr 400 "missing parameter" "" [])
153+ Just n -> throwError $ ServantErr 400 (n ++ " not found") "" []
154+ Nothing -> throwError $ ServantErr 400 "missing parameter" "" [])
155155 :<|> (\ names -> return (zipWith Person names [0..]))
156156 :<|> return
157157 :<|> (\ _request respond -> respond $ responseLBS HTTP.ok200 [] "rawSuccess")
@@ -212,7 +212,7 @@ type instance AuthClientData (AuthProtect "auth-tag") = ()
212212genAuthHandler :: AuthHandler Request ()
213213genAuthHandler =
214214 let handler req = case lookup "AuthHeader" (requestHeaders req) of
215− Nothing -> throwE (err401 { errBody = "Missing auth header" })
215+ Nothing -> throwError (err401 { errBody = "Missing auth header" })
216216 Just _ -> return ()
217217 in mkAuthHandler handler
218218
@@ -298,7 +298,7 @@ sucessSpec = beforeAll (startWaiApp server) $ afterAll endWaiApp $ do
298298
299299wrappedApiSpec :: Spec
300300wrappedApiSpec = describe "error status codes" $ do
301− let serveW api = serve api $ throwE $ ServantErr 500 "error message" "" []
301+ let serveW api = serve api $ throwError $ ServantErr 500 "error message" "" []
302302 context "are correctly handled by the client" $
303303 let test :: (WrappedApi, String) -> Spec
304304 test (WrappedApi api, desc) =