fix: replace json parser error with generic msg (#3090)

This commit is contained in:
Andrei Dziahel
2023-12-12 18:46:40 -05:00
committed by Laurence Isla
parent ceda77c5de
commit 0ac4d0d0a9
4 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -44,7 +44,7 @@ spec actualPgVersion = do
it "fails with 400 and error" $
request methodPatch "/simple_pk" [] "}{ x = 2"
`shouldRespondWith`
[json|{"message":"Error in $: Failed reading: not a valid json value at '}{x=2'","code":"PGRST102","details":null,"hint":null}|]
[json|{"message":"Empty or invalid json","code":"PGRST102","details":null,"hint":null}|]
{ matchStatus = 400,
matchHeaders = [matchContentTypeJson]
}
@@ -53,7 +53,7 @@ spec actualPgVersion = do
it "fails with 400 and error" $
request methodPatch "/items" [] ""
`shouldRespondWith`
[json|{"message":"Error in $: not enough input","code":"PGRST102","details":null,"hint":null}|]
[json|{"message":"Empty or invalid json","code":"PGRST102","details":null,"hint":null}|]
{ matchStatus = 400,
matchHeaders = [matchContentTypeJson]
}