From 7ca6b26b782102ca6645c7a1cd3c4761138763ff Mon Sep 17 00:00:00 2001 From: Alp Mestanogullari Date: Tue, 28 Oct 2014 16:52:30 +0100 Subject: [PATCH] raise InvalidBody when failing to decode the request body --- src/Servant/API/ReqBody.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Servant/API/ReqBody.hs b/src/Servant/API/ReqBody.hs index 70bba000..8cc1353f 100644 --- a/src/Servant/API/ReqBody.hs +++ b/src/Servant/API/ReqBody.hs @@ -26,7 +26,7 @@ instance (FromJSON a, HasServer sublayout) route Proxy subserver request respond = do mrqbody <- decode' <$> lazyRequestBody request case mrqbody of - Nothing -> respond $ failWith NotFound + Nothing -> respond $ failWith InvalidBody Just v -> route (Proxy :: Proxy sublayout) (subserver v) request respond instance (ToJSON a, HasClient sublayout)