mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-04-27 00:56:23 +00:00
Do not show a zero error code when cli exits from showing help (#935)
asyncclick raises a custom runtime exception when exiting help. This suppresses reporting it.
This commit is contained in:
parent
c1e14832ef
commit
b217811096
@ -111,6 +111,10 @@ def CatchAllExceptions(cls):
|
|||||||
def _handle_exception(debug, exc):
|
def _handle_exception(debug, exc):
|
||||||
if isinstance(exc, click.ClickException):
|
if isinstance(exc, click.ClickException):
|
||||||
raise
|
raise
|
||||||
|
# Handle exit request from click.
|
||||||
|
if isinstance(exc, click.exceptions.Exit):
|
||||||
|
sys.exit(exc.exit_code)
|
||||||
|
|
||||||
echo(f"Raised error: {exc}")
|
echo(f"Raised error: {exc}")
|
||||||
if debug:
|
if debug:
|
||||||
raise
|
raise
|
||||||
|
Loading…
x
Reference in New Issue
Block a user