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

This commit is contained in:
Taimoor Zaeem
2024-05-09 18:56:47 +02:00
committed by Wolfgang Walther
parent 903537d39d
commit 077e4a857e
5 changed files with 18 additions and 0 deletions
+1
View File
@@ -482,6 +482,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" ->