Merge pull request #31 from haskell-servant/wip-incorrect-error

Change JSON-specific error message to a more general one
This commit is contained in:
Alp Mestanogullari 2015-03-05 18:56:16 +01:00
commit 947815e6d3

View file

@ -71,7 +71,7 @@ toApplication ra request respond = do
routingRespond (Left WrongMethod) =
respond $ responseLBS methodNotAllowed405 [] "method not allowed"
routingRespond (Left (InvalidBody err)) =
respond $ responseLBS badRequest400 [] $ fromString $ "Invalid JSON in request body: " ++ err
respond $ responseLBS badRequest400 [] $ fromString $ "invalid request body: " ++ err
routingRespond (Left UnsupportedMediaType) =
respond $ responseLBS unsupportedMediaType415 [] "unsupported media type"
routingRespond (Left (HttpError status body)) =