Skip to content

ux(sql-workspace): readable query errors: driver message first, details folded and unwrapped, Copy (#1557) - #1701

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
ux/query-error-summary
Oct 17, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
ux/query-error-summary

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Refs #1557 (items 1 and 2; the caret jump and the MongoDB panel are not in this PR).

A failed query showed the driver exception as-is: the same message twice (SqliteFfiException(...) around DatabaseException(...)), class names, and the statement the app wraps around the user's SQL (SELECT * FROM ( ... ) LIMIT 5000, #1144), with a position that counts from that wrapper.

QueryErrorText.parse(raw) (lib/core/database/query_error_text.dart, pure):

  • summary: the driver's message alone. SQLite SqliteException(n): while ..., <message>, ... (code n), PostgreSQL Severity.error XXXXX: <message> (without detail: / hint:), MySQL MySQLServerException [n]: <message>; anything else its first line (a leading Exception: dropped). Cut at 300 characters.
  • detail: the whole text with the app's SELECT * FROM (\n...\n) wrapper and the row limit after it replaced by the user's SQL, and the misleading (at position N) removed when a wrapper was there. Text without a wrapper is unchanged.

Results pane (ResultsTab): the summary is the headline (selectable, normal text colour); when there is more, Show details unfolds the detail (scrolls in a short pane, as before) and Copy error copies it ("Copied" for 2 s). A one-line error looks as before. Timeouts and other app messages go through the same path and read as before.

Example from the issue now reads no such column: u.name.

Not done: putting the caret / a squiggle at the error position (needs the position translated back to the user's text), and the same panel for MongoDB's Query Error.

Tests: the parser for SQLite (the issue's example), PostgreSQL, MySQL, a plain message, text without a wrapper and a very long message; the pane shows the headline with details folded, unfolds them without the wrapper, copies the unwrapped text, and shows no details for a one-line error. The existing error-pane tests are unchanged.

…, details folded and without the app's wrapper, with Copy (#1557)
@github-actions github-actions Bot added enhancement New feature or request error-handling Theme parser epic label: error-handling ui User interface components and widgets ux User experience, keyboard shortcuts and interactions P2 Medium priority / Parity & Refactoring labels Oct 17, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 45bcbc8 into dev Oct 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request error-handling Theme parser epic label: error-handling P2 Medium priority / Parity & Refactoring ui User interface components and widgets ux User experience, keyboard shortcuts and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant