feat: improve PGRST121 error message

* Clarify the message field
* Show failed MESSAGE or DETAIL in the the PGRST121 error's details field
* Show the correct JSON format in the hint field
This commit is contained in:
Laurence Isla
2024-04-24 13:33:10 -05:00
committed by GitHub
parent 3eff4670f0
commit 69bbce5b32
4 changed files with 64 additions and 25 deletions
+7 -1
View File
@@ -25,6 +25,7 @@ module PostgREST.ApiRequest.Types
, OrderNulls(..)
, OrderTerm(..)
, QPError(..)
, RaiseError(..)
, RangeError(..)
, SingleVal
, TrileanVal(..)
@@ -95,12 +96,17 @@ data ApiRequestError
| OffLimitsChangesError Int64 Integer
| PutMatchingPkError
| SingularityError Integer
| PGRSTParseError
| PGRSTParseError RaiseError
| MaxAffectedViolationError Integer
deriving Show
data QPError = QPError Text Text
deriving Show
data RaiseError
= MsgParseError ByteString
| DetParseError ByteString
| NoDetail
deriving Show
data RangeError
= NegativeLimit
| LowerGTUpper