Repository navigation
ux(sql-workspace): readable query errors: driver message first, details folded and unwrapped, Copy (#1557) - #1701
Merged
Merged
Conversation
…, details folded and without the app's wrapper, with Copy (#1557)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(...)aroundDatabaseException(...)), 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):SqliteException(n): while ..., <message>, ... (code n), PostgreSQLSeverity.error XXXXX: <message>(withoutdetail:/hint:), MySQLMySQLServerException [n]: <message>; anything else its first line (a leadingException:dropped). Cut at 300 characters.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.