Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"back": "Back",
"defaultMessage": "An unexpected error occurred",
"home": "Home",
"invalidUrl": "Page Not Found. Please check the URL and try again.",
"notFound": "Page Not Found",
"title": "Error"
},
Expand Down
5 changes: 4 additions & 1 deletion airflow-core/src/airflow/ui/src/pages/Error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export const ErrorPage = () => {
let errorMessage = translate("error.defaultMessage");
let statusCode = "";

if (isRouteErrorResponse(error)) {
if (error === null || error === undefined) {
statusCode = "404";
errorMessage = translate("error.invalidUrl");
} else if (isRouteErrorResponse(error)) {
statusCode = String(error.status);
errorMessage =
((error as unknown as Error).message || (error as { statusText?: string }).statusText) ??
Expand Down
4 changes: 4 additions & 0 deletions airflow-core/src/airflow/ui/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ export const routerConfig = [
element: <Task />,
path: "dags/:dagId/tasks/:taskId",
},
{
element: <ErrorPage />,
path: "*",
},
],
element: <BaseLayout />,
errorElement: (
Expand Down