import { isRouteErrorResponse, Outlet } from "react-router";
import "./app.css";
export default function Root() {
return ;
}
export function ErrorBoundary({ error }: any) {
let status = 500;
let heading = "Something went wrong";
let message = "An unexpected error occurred. Please try again.";
let stack: string | undefined;
if (isRouteErrorResponse(error)) {
status = error.status;
if (status === 404) {
heading = "Page not found";
message = "The page you're looking for doesn't exist or has been moved.";
} else {
heading = `${status} Error`;
message = error.statusText || message;
}
} else if (error instanceof Error) {
message = error.message;
stack = error.stack;
}
const is404 = status === 404;
return (
{status}
{heading}
{message}
Go to Runs
{stack && (
Stack trace
{stack}
)}
);
}