This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new e8626d07446 Simplify airflowctl exceptions in safe_call_command method 
(#59808)
e8626d07446 is described below

commit e8626d074460548640437948ac4bde3cefe4320a
Author: GPK <[email protected]>
AuthorDate: Thu Dec 25 23:19:53 2025 +0000

    Simplify airflowctl exceptions in safe_call_command method (#59808)
---
 airflow-ctl/src/airflowctl/ctl/cli_config.py | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/airflow-ctl/src/airflowctl/ctl/cli_config.py 
b/airflow-ctl/src/airflowctl/ctl/cli_config.py
index da548530eb0..d79f15dcf0a 100644
--- a/airflow-ctl/src/airflowctl/ctl/cli_config.py
+++ b/airflow-ctl/src/airflowctl/ctl/cli_config.py
@@ -74,13 +74,11 @@ def safe_call_command(function: Callable, args: 
Iterable[Arg]) -> None:
 
     try:
         function(args)
-    except AirflowCtlCredentialNotFoundException as e:
-        rich.print(f"command failed due to {e}")
-        sys.exit(1)
-    except AirflowCtlConnectionException as e:
-        rich.print(f"command failed due to {e}")
-        sys.exit(1)
-    except AirflowCtlNotFoundException as e:
+    except (
+        AirflowCtlCredentialNotFoundException,
+        AirflowCtlConnectionException,
+        AirflowCtlNotFoundException,
+    ) as e:
         rich.print(f"command failed due to {e}")
         sys.exit(1)
     except (httpx.RemoteProtocolError, httpx.ReadError) as e:

Reply via email to