Replaced sys.exit() with ClickException in test_connection decorator.…#3705
Open
pui1ya wants to merge 1 commit intoaugurlabs:mainfrom
Open
Replaced sys.exit() with ClickException in test_connection decorator.…#3705pui1ya wants to merge 1 commit intoaugurlabs:mainfrom
pui1ya wants to merge 1 commit intoaugurlabs:mainfrom
Conversation
… Established initial exception handling pattern for CLI failures as discussed in augurlabs#3676.
Collaborator
|
This looks like a small, focused first PR, nice! Could you test to make sure this works by maybe running the augur CLI |
Author
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.

Summary
This PR replaces one occurrence of
sys.exit()withclick.ClickExceptionin the network connectivity check.
Motivation
As discussed in #3676,
sys.exit()bypasses Python's exception handlingand makes testing and error propagation harder. This change establishes a
pattern for handling CLI failures using Click's exception system.
Changes
sys.exit()withclick.ClickExceptionTesting
python -m pytestNote: This is intended as the first incremental change before updating the
remaining occurrences.