fix: wrong subquery error returning as 400 status

This commit is contained in:
steve-chavez
2024-02-02 22:08:56 -05:00
committed by Steve Chavez
parent bbc0bda6f5
commit 45cabacdcc
5 changed files with 18 additions and 3 deletions
+8 -2
View File
@@ -9,8 +9,8 @@ import Test.Hspec.Wai.JSON
import Protolude hiding (get)
spec :: SpecWith ((), Application)
spec = do
nonExistentSchema :: SpecWith ((), Application)
nonExistentSchema = do
describe "Non existent api schema" $ do
it "succeeds when requesting root path" $
get "/" `shouldRespondWith` 200
@@ -61,3 +61,9 @@ spec = do
"code": "PGRST117",
"message":"Unsupported HTTP method: OTHER"}|]
{ matchStatus = 405 }
pgErrorCodeMapping :: SpecWith ((), Application)
pgErrorCodeMapping = do
describe "PostreSQL error code mappings" $ do
it "should return 500 for cardinality_violation" $
get "/bad_subquery" `shouldRespondWith` 500