ReviewOS

stacks/bun-query-builder

Dead sql.catch block in getBunSql — handler can never fire and would re-mask #1022 errors

#1039
Closed glennmichael123 opened this 22 days ago · 0 comments
22 days ago

Summary

In getBunSql, the if (sql && typeof (sql as any).catch === 'function') block is dead — Bun's SQL instance is not a Promise and has no .catch, so the guard is always false. Even if it fired, it's verbose-gated and filters out exactly the "database…does not exist" errors that #1022 was about surfacing — contradicting the fail-loudly fix ~30 lines below.

Location

src/db.ts:~430-436.

Suggested fix

Delete the block. Connection errors are already handled by the try/catch (re-throw) and the process-level handler.

Severity: low (cleanup). Found via internal code audit.

Sign in to comment on this issue.