raise InvalidBody when failing to decode the request body
This commit is contained in:
parent
9ade9a43f3
commit
7ca6b26b78
1 changed files with 1 additions and 1 deletions
|
@ -26,7 +26,7 @@ instance (FromJSON a, HasServer sublayout)
|
||||||
route Proxy subserver request respond = do
|
route Proxy subserver request respond = do
|
||||||
mrqbody <- decode' <$> lazyRequestBody request
|
mrqbody <- decode' <$> lazyRequestBody request
|
||||||
case mrqbody of
|
case mrqbody of
|
||||||
Nothing -> respond $ failWith NotFound
|
Nothing -> respond $ failWith InvalidBody
|
||||||
Just v -> route (Proxy :: Proxy sublayout) (subserver v) request respond
|
Just v -> route (Proxy :: Proxy sublayout) (subserver v) request respond
|
||||||
|
|
||||||
instance (ToJSON a, HasClient sublayout)
|
instance (ToJSON a, HasClient sublayout)
|
||||||
|
|
Loading…
Reference in a new issue