Skip to content

Commit 4027930

Browse files
committed
fix(db): correct misleading error message when DATABASE_REPLICA_URL is malformed
The error message said reads fall back to the primary when unset, but the code throws a fatal error instead. The misleading parenthetical contradicted actual behavior and could waste time during incident response when an operator sees this message and expects graceful degradation.
1 parent 79d98b3 commit 4027930

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/db/db.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const db = drizzle(postgresClient, { schema })
3131
const replicaUrl = process.env.DATABASE_REPLICA_URL
3232
if (replicaUrl && !/^postgres(ql)?:\/\//.test(replicaUrl)) {
3333
throw new Error(
34-
'DATABASE_REPLICA_URL is set but is not a postgres:// DSN — fix or unset it (reads fall back to the primary when unset)'
34+
'DATABASE_REPLICA_URL is set but is not a postgres:// DSN — fix the URL or unset the variable'
3535
)
3636
}
3737

0 commit comments

Comments
 (0)