Skip to content

Commit 51733b8

Browse files
salarkhannnwaleedlatif1TheodoreSpeaksSg312icecrasher321
authored
fix(db): correct misleading error message when DATABASE_REPLICA_URL is malformed (#5023)
* v0.6.29: login improvements, posthog telemetry (#4026) * feat(posthog): Add tracking on mothership abort (#4023) Co-authored-by: Theodore Li <theo@sim.ai> * fix(login): fix captcha headers for manual login (#4025) * fix(signup): fix turnstile key loading * fix(login): fix captcha header passing * Catch user already exists, remove login form captcha * 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. --------- Co-authored-by: Waleed <walif6@gmail.com> Co-authored-by: Theodore Li <theodoreqili@gmail.com> Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: Theodore Li <theo@sim.ai>
1 parent 9a4c9d2 commit 51733b8

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)