Skip to content

Exit on error for --execute containing /source - #2152

Merged
rolandwalker merged 1 commit into
mainfrom
RW/source-error-warn-exit
Aug 22, 2026
Merged

Exit on error for --execute containing /source#2152
rolandwalker merged 1 commit into
mainfrom
RW/source-error-warn-exit

Conversation

@rolandwalker

Copy link
Copy Markdown
Contributor

Description

If a /source'd file contains a special command, and the --special flag was not given to /source, then --execute should be able to print an error message to the stderr and exit with an exit code.

The error message was previously visible only at the REPL.

This requires adding an is_error property to SQLResult, which may be useful in other contexts.

This is strictly the fix for the report in #2148 .

xref #2151.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

If a /source'd file contains a special command, and the --special flag
was not given to /source, then --execute should be able to print an
error message to the stderr and exit with an exit code.

The error message was previously visible only at the REPL.

This requires adding an is_error property to SQLResult, which may be
useful in other contexts.
@rolandwalker rolandwalker self-assigned this Aug 22, 2026
@rolandwalker
rolandwalker merged commit 6ea837f into main Aug 22, 2026
11 checks passed
@rolandwalker
rolandwalker deleted the RW/source-error-warn-exit branch August 22, 2026 13:19
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.

1 participant