Skip to content

Say which statement failed in a script, and keep the earlier results #845

Closed

Description

@EVWorth

Severity: P2.

What happens

On http://localhost:1420/?mock=connected, run this with Ctrl+Shift+Enter:

SELECT * FROM products;
SELECT * FROM nope;
SELECT 1;

The results pane shows a red "Query Error" box reading only "Error: Table 'shop.nope' doesn't exist". It does not say which statement or line failed, and it shows no error code (1146). Nothing is marked in the editor, and the first statement's results, which succeeded, are discarded.

Cause

  • The backend and the mock reject with a structured error carrying statementIndex, but CommandError keeps only code and sqlState (src/lib/tauri-api.ts:49-60), so the index is lost.
  • src/stores/resultStore.ts:491 sets results: [] on any failure.
  • The placeholder renders String(e) (src/components/grid/GridPlaceholder.tsx:36-48).

Fix

  • Carry statementIndex on CommandError.
  • Show "Statement 2 of 3 failed (1146)" with the statement text.
  • Add a Monaco error marker on that statement's range.
  • Keep and show the results of the statements before it.

Part of #783.

Activity

  1. added
    bug
    on Oct 21, 2026
  2. EVWorth commented on Oct 30, 2026

    @EVWorth
    OwnerAuthor

    Done across #908 (frontend), #916 (completedResults from the backend) and #926 (timeouts keep them too). #922 adds an end-to-end test through the mock.


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions