fix: fix wrong http status on pg error 42P17 infinite recursion

This commit is contained in:
Taimoor Zaeem
2024-04-22 13:40:07 -05:00
committed by Steve Chavez
parent 80f83f0366
commit 88abf600c4
5 changed files with 18 additions and 0 deletions
+1
View File
@@ -489,6 +489,7 @@ pgErrorStatus authed (SQL.SessionUsageError (SQL.QueryError _ _ (SQL.ResultError
then HTTP.status406
else HTTP.status404 -- undefined function
"42P01" -> HTTP.status404 -- undefined table
"42P17" -> HTTP.status500 -- infinite recursion
"42501" -> if authed then HTTP.status403 else HTTP.status401 -- insufficient privilege
'P':'T':n -> fromMaybe HTTP.status500 (HTTP.mkStatus <$> readMaybe n <*> pure m)
"PGRST" ->