Ensure payload parse errors are not suppressed

Fixes #490
This commit is contained in:
Joe Nelson
2016-02-11 16:24:02 -08:00
parent ce6e52e9ba
commit 8b3d224b80
3 changed files with 29 additions and 15 deletions
+3 -5
View File
@@ -179,16 +179,14 @@ app dbStructure conf reqBody req =
body <- encode <$> H.query schema accessibleTables
return $ responseLBS status200 [jsonH] $ cs body
(ActionUnknown _, _, _) -> return notFound
(_, TargetProc _, _) -> return $ responseLBS status405 [] ""
(_, TargetUnknown _, _) -> return notFound
(ActionInappropriate, _, _) -> return $ responseLBS status405 [] ""
(_, _, Just (PayloadParseError e)) ->
return $ responseLBS status400 [jsonH] $
cs (formatGeneralError "Cannot parse request payload" (cs e))
(_, TargetUnknown _, _) -> return notFound
(_, _, _) -> return notFound
where