Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli exception handling #1951

Merged
merged 5 commits into from
Oct 16, 2024
Merged

cli exception handling #1951

merged 5 commits into from
Oct 16, 2024

Conversation

sh-rp
Copy link
Collaborator

@sh-rp sh-rp commented Oct 14, 2024

Description

This PR adds standardized exception handling for the cli plugins.

This includes:

  • If a command executes without exception, by default there will be a return code of 0
  • If an unknown exception occurs, the return code will be -1 and the default docs url for the command (or base docs url) will be printed out as guidance
  • If a known error occurs, the command can throw a CliCommandException to control the return code, provide a custom docs url and determin wether there should be an exception raise if the debug flag is set to true

Notes:
The default return code for unknown exceptions always is -1, so some existing codes have changed so there is no overlap.

Copy link

netlify bot commented Oct 14, 2024

Deploy Preview for dlt-hub-docs canceled.

Name Link
🔨 Latest commit 02ffa59
🔍 Latest deploy log https://app.netlify.com/sites/dlt-hub-docs/deploys/670f54d89e657d00084ada56

@sh-rp sh-rp marked this pull request as ready for review October 14, 2024 13:07
Copy link
Collaborator

@rudolfix rudolfix left a comment

Choose a reason for hiding this comment

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

LGTM! thanks for fixing all standard commands

Copy link
Collaborator

@rudolfix rudolfix left a comment

Choose a reason for hiding this comment

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

deploy tests are failing

@sh-rp sh-rp force-pushed the fix/fallback_cli_exception_handling branch from 9d4eec1 to b4161a2 Compare October 15, 2024 21:54
@sh-rp sh-rp force-pushed the fix/fallback_cli_exception_handling branch from b4161a2 to 02ffa59 Compare October 16, 2024 05:53
@sh-rp sh-rp merged commit 1918480 into devel Oct 16, 2024
58 of 61 checks passed
@sh-rp sh-rp deleted the fix/fallback_cli_exception_handling branch October 16, 2024 12:27
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.

2 participants