Skip to content

Commit

Permalink
Password Error Handling Fix (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraftp authored Jan 16, 2025
1 parent 7b86e07 commit 6166748
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dbos/_db_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ def db_connect(config: "ConfigFile", config_file_path: str) -> "ConfigFile":
return config

# 2. If the error is due to password authentication or the configuration is non-default, surface the error and exit.
if "password authentication failed" in str(db_connection_error) or "28P01" in str(
db_connection_error
error_str = str(db_connection_error)
if (
"password authentication failed" in error_str
or "28P01" in error_str
or "no password supplied" in error_str
):
raise DBOSInitializationError(
f"Could not connect to Postgres: password authentication failed: {db_connection_error}"
Expand Down

0 comments on commit 6166748

Please sign in to comment.