Skip to content

Conversation

@itslenny
Copy link
Contributor

@itslenny itslenny commented Nov 10, 2025

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

When connectionTimeoutMillis elapses a "timeout expired" error is thrown resulting in an incorrect 500 error

What is the new behavior?

Catch the "timeout expired" error and throw it as a 544 instead

Additional context

Error: timeout expired
              at Timeout._onTimeout (/Users/lenny/also-work/storage/node_modules/pg/lib/client.js:108:28)
              at listOnTimeout (node:internal/timers:588:17)
              at process.processTimers (node:internal/timers:523:7)

This error is thrown here in the node-postres lib: https://github.com/brianc/node-postgres/blob/8d493f3b5531bfe226d40c1d64d1d020ee33fd6f/packages/pg/lib/client.js#L147

@itslenny itslenny merged commit 5008f65 into master Nov 10, 2025
2 checks passed
@itslenny itslenny deleted the fix/handle-databse-timeout-errors branch November 10, 2025 14:23
@coveralls
Copy link

Pull Request Test Coverage Report for Build 19233186378

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 6 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 77.782%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/internal/database/connection.ts 0 6 0.0%
Totals Coverage Status
Change from base Build 19169968447: -0.01%
Covered Lines: 24603
Relevant Lines: 31305

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants