chore: improve details field of the singular error response (#2876)

This commit is contained in:
Taimoor Zaeem
2023-08-01 19:37:54 -05:00
committed by GitHub
parent 40c2bcd4a1
commit d0a71de2da
3 changed files with 18 additions and 17 deletions
+1 -1
View File
@@ -530,7 +530,7 @@ instance JSON.ToJSON Error where
toJSON (SingularityError n) = JSON.object [
"code" .= ApiRequestErrorCode16,
"message" .= ("JSON object requested, multiple (or no) rows returned" :: Text),
"details" .= T.unwords ["Results contain", show n, "rows,", T.decodeUtf8 (MediaType.toMime MTSingularJSON), "requires 1 row"],
"details" .= T.unwords ["The result contains", show n, "rows"],
"hint" .= JSON.Null]
toJSON (PgErr err) = JSON.toJSON err