Add 'PGRST' error code to differentiate from PostgreSQL errors

This commit is contained in:
Laurence Isla
2022-03-04 15:57:38 -05:00
committed by GitHub
parent 99d0b805df
commit d6834e8bf8
17 changed files with 399 additions and 156 deletions
@@ -68,7 +68,7 @@ spec =
it "fails trying to read table from unkown schema" $
request methodGet "/parents" [("Accept-Profile", "unkown")] "" `shouldRespondWith`
[json|{"message":"The schema must be one of the following: v1, v2"}|]
[json|{"message":"The schema must be one of the following: v1, v2","code":"PGRST106","details":null,"hint":null}|]
{
matchStatus = 406
}
@@ -111,7 +111,7 @@ spec =
request methodPost "/children" [("Content-Profile", "unknown")]
[json|{"name": "child 4", "parent_id": 4}|]
`shouldRespondWith`
[json|{"message":"The schema must be one of the following: v1, v2"}|]
[json|{"message":"The schema must be one of the following: v1, v2","code":"PGRST106","details":null,"hint":null}|]
{
matchStatus = 406
}
@@ -325,7 +325,7 @@ spec =
it "fails trying to read definitions from unkown schema" $
request methodGet "/" [("Accept-Profile", "unkown")] "" `shouldRespondWith`
[json|{"message":"The schema must be one of the following: v1, v2"}|]
[json|{"message":"The schema must be one of the following: v1, v2","code":"PGRST106","details":null,"hint":null}|]
{
matchStatus = 406
}