Skip to content

Commit e8626d0

Browse files
Simplify airflowctl exceptions in safe_call_command method (#59808)
1 parent b1b1f95 commit e8626d0

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

airflow-ctl/src/airflowctl/ctl/cli_config.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,11 @@ def safe_call_command(function: Callable, args: Iterable[Arg]) -> None:
7474

7575
try:
7676
function(args)
77-
except AirflowCtlCredentialNotFoundException as e:
78-
rich.print(f"command failed due to {e}")
79-
sys.exit(1)
80-
except AirflowCtlConnectionException as e:
81-
rich.print(f"command failed due to {e}")
82-
sys.exit(1)
83-
except AirflowCtlNotFoundException as e:
77+
except (
78+
AirflowCtlCredentialNotFoundException,
79+
AirflowCtlConnectionException,
80+
AirflowCtlNotFoundException,
81+
) as e:
8482
rich.print(f"command failed due to {e}")
8583
sys.exit(1)
8684
except (httpx.RemoteProtocolError, httpx.ReadError) as e:

0 commit comments

Comments
 (0)