raise InvalidBody when failing to decode the request body
commit7ca6b26b782102ca6645c7a1cd3c4761138763ff
authorAlp Mestanogullari <alpmestan@gmail.com>
dateTue 28 Oct 2014, 16:52 (12 years ago)
parent9ade9a4
src/Servant/API/ReqBody.hs+1−1
@@ -26,7 +26,7 @@ instance (FromJSON a, HasServer sublayout)
2626 route Proxy subserver request respond = do
2727 mrqbody <- decode' <$> lazyRequestBody request
2828 case mrqbody of
29− Nothing -> respond $ failWith NotFound
29+ Nothing -> respond $ failWith InvalidBody
3030 Just v -> route (Proxy :: Proxy sublayout) (subserver v) request respond
3131
3232instance (ToJSON a, HasClient sublayout)