Skip to content

fix(errors): pool exhaustion, lost sessions and TLS failures read as what they are (#1316) - #1328

Merged
ZhuchkaTriplesix merged 3 commits into
devfrom
fix/1316-error-mapping-gaps
Oct 10, 2026
Merged

ZhuchkaTriplesix merged 3 commits into
devfrom
fix/1316-error-mapping-gaps

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1316

Problem

  1. The pools threw StateError('... connection pool exhausted: 32 slots in use.') and it reached the user as Bad state: PostgreSQL connection pool exhausted....
  2. Any SocketException was HostUnreachableException (did not accept the connection), including Connection reset by peer and Broken pipe on a session that had been working.
  3. HandshakeException, CERTIFICATE_VERIFY_FAILED, unknown ca, wrong version number and the like were unmapped: the raw text, with no hint about the SSL mode or the root certificate.

Fix (database_error_mapper.dart, querya_database_exception.dart, the three pools)

  • PoolExhaustedException: The PostgreSQL connection pool is full: 32 sessions are in use. Close tabs or connections you no longer use, then try again (also MySQL, SQLite).
  • ConnectionLostException for reset / broken pipe / closed connection / terminating connection / server has gone away / lost connection, with a reconnect hint. Checked before the refused-connection mapping.
  • TlsFailureException for TlsException and certificate / handshake / protocol-version texts, pointing at the SSL mode and the root certificate (and at turning SSL off for a server without TLS).

Tests: mapper — five wordings of a lost session (none is a refusal), a refused connection is still unreachable, three TLS failures with the hint, an authentication failure is not TLS; pools — a full PostgreSQL / SQLite / MySQL pool throws the typed exception whose text names the engine, has the hint and no Bad state (the MySQL test that expected StateError was updated).

…what they are (#1316)

- A full pool is a PoolExhaustedException (the session count and what to
  do), not Bad state: ...
- Connection reset / broken pipe / terminating connection / server gone
  away on an established session is ConnectionLostException with a
  reconnect hint, not did not accept the connection.
- HandshakeException and certificate / TLS-version failures are
  TlsFailureException pointing at the SSL mode and root certificate.
@github-actions github-actions Bot added bug Something isn't working error-handling Theme parser epic label: error-handling ux User experience, keyboard shortcuts and interactions P3 Low priority / Polish & Enhancements labels Oct 10, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 24be31c into dev Oct 10, 2026
15 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the fix/1316-error-mapping-gaps branch October 11, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working error-handling Theme parser epic label: error-handling P3 Low priority / Polish & Enhancements ux User experience, keyboard shortcuts and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant