liamkernan commented on code in PR #61560:
URL: https://github.com/apache/airflow/pull/61560#discussion_r2879032073
##########
airflow-core/src/airflow/ui/src/queries/useDagParsing.ts:
##########
@@ -24,16 +24,23 @@ import {
UseDagServiceGetDagDetailsKeyFn,
UseDagSourceServiceGetDagSourceKeyFn,
} from "openapi/queries";
+import { ApiError } from "openapi/requests";
import { toaster } from "src/components/ui";
export const useDagParsing = ({ dagId }: { readonly dagId: string }) => {
const queryClient = useQueryClient();
const { t: translate } = useTranslation("dag");
- const onError = () => {
+ const onError = (error: unknown) => {
+ const isForbidden = error instanceof ApiError && error.status === 403;
Review Comment:
Updated per suggestion, I removed the instanceof ApiError check and now use
(error as ExpandedApiError).status === 403, consistent with existing patterns
in the codebase.
--
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]