fix: consider authentication failure as a fatal error

This commit is contained in:
Tuan Le
2023-02-02 03:30:15 -05:00
committed by Steve Chavez
parent 81501aefa0
commit 557285b659
5 changed files with 28 additions and 3 deletions
+1 -1
View File
@@ -428,7 +428,7 @@ checkIsFatal :: PgError -> Maybe Text
checkIsFatal (PgError _ (SQL.ConnectionUsageError e))
| isAuthFailureMessage = Just $ toS failureMessage
| otherwise = Nothing
where isAuthFailureMessage = "FATAL: password authentication failed" `isPrefixOf` failureMessage
where isAuthFailureMessage = "FATAL: password authentication failed" `isInfixOf` failureMessage
failureMessage = BS.unpack $ fromMaybe mempty e
checkIsFatal (PgError _ (SQL.SessionUsageError (SQL.QueryError _ _ (SQL.ResultError serverError))))
= case serverError of