Skip to content

Fix CLI error handling and exit codes for failed commands#65052

Merged
bugraoz93 merged 1 commit intoapache:mainfrom
rjgoyln:fix/cli-exit-code
Apr 12, 2026
Merged

Fix CLI error handling and exit codes for failed commands#65052
bugraoz93 merged 1 commit intoapache:mainfrom
rjgoyln:fix/cli-exit-code

Conversation

@rjgoyln
Copy link
Copy Markdown
Contributor

@rjgoyln rjgoyln commented Apr 11, 2026

Summary

This PR fixes an issue in CLI error handling where certain failures (e.g. network or server errors) were only printed but did not cause the process to exit with a non-zero status code.
As a result, CI systems could incorrectly interpret failed executions as successful runs.
This change ensures proper error propagation and correct exit code behavior for CLI failures.

Changes

  • Ensure all CLI execution errors properly trigger failure exit codes
  • Ensure sys.exit(1) is triggered on all failure cases

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Copy link
Copy Markdown
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think this needs revision

Copy link
Copy Markdown
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Overlooked the file in the first round :)

@bugraoz93 bugraoz93 merged commit 9f8678a into apache:main Apr 12, 2026
9 checks passed
bugraoz93 pushed a commit to bugraoz93/airflow that referenced this pull request Apr 12, 2026
…apache#65052)

(cherry picked from commit 9f8678a)

Co-authored-by: rjgoyln <151457491+rjgoyln@users.noreply.github.com>
bugraoz93 added a commit that referenced this pull request Apr 12, 2026
…#65052) (#65097)

(cherry picked from commit 9f8678a)

Co-authored-by: rjgoyln <151457491+rjgoyln@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants