Skip to content

Commit

Permalink
Password Error Handling Fix (#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraftp authored Jan 16, 2025
1 parent 854166d commit 705a7b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dbos-runtime/db_wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export async function db_wizard(poolConfig: PoolConfig): Promise<PoolConfig> {

// 2. If the error is due to password authentication or the configuration is non-default, surface the error and exit.
const errorStr = dbConnectionError.toString();
if (errorStr.includes('password authentication failed') || errorStr.includes('28P01')) {
if (errorStr.includes('password authentication failed')
|| errorStr.includes('28P01')
|| errorStr.includes("no password supplied")
|| errorStr.includes("client password must be a string")) {
throw new DBOSInitializationError(
`Could not connect to Postgres: password authentication failed: ${errorStr}`
);
Expand Down

0 comments on commit 705a7b8

Please sign in to comment.