This is an automated email from the ASF dual-hosted git repository.
bbovenzi 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 ef32e9f69a5 Surface connection test errors in the UI instead of
failing silently (#71954)
ef32e9f69a5 is described below
commit ef32e9f69a563ad26e7991f6e55dde89b6fc6b8b
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Fri Aug 21 21:46:07 2026 +0200
Surface connection test errors in the UI instead of failing silently
(#71954)
Testing a connection only reported success or a failed test result; if the
request itself errored the handler set the connection state to failed and
showed nothing, leaving the user with a red icon and no explanation of what
went wrong. Route those errors through the shared error toaster like every
other mutation so the reason is shown.
---
airflow-core/src/airflow/ui/src/queries/useTestConnection.ts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/airflow-core/src/airflow/ui/src/queries/useTestConnection.ts
b/airflow-core/src/airflow/ui/src/queries/useTestConnection.ts
index 5a810a223ff..d5c15c77bda 100644
--- a/airflow-core/src/airflow/ui/src/queries/useTestConnection.ts
+++ b/airflow-core/src/airflow/ui/src/queries/useTestConnection.ts
@@ -22,6 +22,7 @@ import { useTranslation } from "react-i18next";
import { useConnectionServiceTestConnection } from "openapi/queries";
import type { ConnectionTestResponse } from "openapi/requests/types.gen";
import { toaster } from "src/components/ui";
+import { createErrorToaster } from "src/utils";
export const useTestConnection = (setConnected:
Dispatch<SetStateAction<boolean | undefined>>) => {
const { t: translate } = useTranslation("admin");
@@ -43,8 +44,9 @@ export const useTestConnection = (setConnected:
Dispatch<SetStateAction<boolean
}
};
- const onError = () => {
+ const onError = (error: unknown) => {
setConnected(false);
+ createErrorToaster(error, { titleKey: "connections.testError.title" },
translate);
};
return useConnectionServiceTestConnection({