pierrejeambrun commented on code in PR #61588:
URL: https://github.com/apache/airflow/pull/61588#discussion_r2958897443


##########
airflow-core/src/airflow/ui/src/queries/useClearTaskInstances.ts:
##########
@@ -52,6 +52,15 @@ export const useClearTaskInstances = ({
     let detail: string;
     let description: string;
 
+    // Get status from error
+    const status =
+      (error as { status?: number }).status ?? (error as { response?: { 
status?: number } }).response?.status;
+
+    // Skip 403 errors as they are handled by MutationCache
+    if (status === 403) {
+      return;
+    }
+

Review Comment:
   `createErrorToaster` ?



##########
airflow-core/src/airflow/ui/src/queries/useDagParsing.ts:
##########
@@ -25,15 +25,15 @@ import {
   UseDagSourceServiceGetDagSourceKeyFn,
 } from "openapi/queries";
 import { toaster } from "src/components/ui";
-import { createErrorToaster } from "src/components/ui/createErrorToaster";
+import { createErrorToaster } from "src/utils";
 
 export const useDagParsing = ({ dagId }: { readonly dagId: string }) => {
   const queryClient = useQueryClient();
-  const { t: translate } = useTranslation(["dag", "common"]);
-  const onError = createErrorToaster(translate, {
-    description: translate("parse.toaster.error.description"),
-    title: translate("parse.toaster.error.title"),
-  });
+  const { t: translate } = useTranslation("dag");
+
+  const onError = (error: unknown) => {
+    createErrorToaster(error, { titleKey: "dag:parse.toaster.error.title" }, 
translate);
+  };

Review Comment:
   You need to delete `createErrorToaster` from 
`src/components/ui/createErrorToaster`, I think it was only used here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to