From c80c9ef72669baa9915bb8e685cb8288d5fb75f5 Mon Sep 17 00:00:00 2001 From: Dan Amoroso Date: Thu, 8 Aug 2019 21:20:06 +0200 Subject: [PATCH] Reword error message for BinaryFieldError (#1372) --- src/PostgREST/Error.hs | 2 +- test/Feature/QuerySpec.hs | 2 +- test/Feature/RpcSpec.hs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PostgREST/Error.hs b/src/PostgREST/Error.hs index fcf41865c..1df8fbdcb 100644 --- a/src/PostgREST/Error.hs +++ b/src/PostgREST/Error.hs @@ -224,7 +224,7 @@ instance JSON.ToJSON SimpleError where toJSON GucHeadersError = JSON.object [ "message" .= ("response.headers guc must be a JSON array composed of objects with a single key and a string value" :: Text)] toJSON (BinaryFieldError ct) = JSON.object [ - "message" .= ((toS (toMime ct) <> " requested but a single column was not selected") :: Text)] + "message" .= ((toS (toMime ct) <> " requested but more than one column was selected") :: Text)] toJSON ConnectionLostError = JSON.object [ "message" .= ("Database connection lost, retrying the connection." :: Text)] diff --git a/test/Feature/QuerySpec.hs b/test/Feature/QuerySpec.hs index 9528a63c6..56451d213 100644 --- a/test/Feature/QuerySpec.hs +++ b/test/Feature/QuerySpec.hs @@ -950,7 +950,7 @@ spec actualPgVersion = do it "fails if a single column is not selected" $ do request methodGet "/images?select=img,name&name=eq.A.png" (acceptHdrs "application/octet-stream") "" `shouldRespondWith` - [json| {"message":"application/octet-stream requested but a single column was not selected"} |] + [json| {"message":"application/octet-stream requested but more than one column was selected"} |] { matchStatus = 406 , matchHeaders = [matchContentTypeJson] } diff --git a/test/Feature/RpcSpec.hs b/test/Feature/RpcSpec.hs index e24237699..63874e63c 100644 --- a/test/Feature/RpcSpec.hs +++ b/test/Feature/RpcSpec.hs @@ -482,7 +482,7 @@ spec actualPgVersion = it "fails if a single column is not selected" $ request methodPost "/rpc/ret_rows_with_base64_bin" (acceptHdrs "application/octet-stream") "" `shouldRespondWith` - [json| {"message":"application/octet-stream requested but a single column was not selected"} |] + [json| {"message":"application/octet-stream requested but more than one column was selected"} |] { matchStatus = 406 , matchHeaders = [matchContentTypeJson] }