From 818b16816e8d018cdfead5851e2e39bbec231159 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Tue, 26 Nov 2024 13:48:17 -0800 Subject: [PATCH] feat: update error page (#1057) --- apps/antalmanac/src/routes/ErrorPage.tsx | 86 ++++++++++++++---------- 1 file changed, 52 insertions(+), 34 deletions(-) diff --git a/apps/antalmanac/src/routes/ErrorPage.tsx b/apps/antalmanac/src/routes/ErrorPage.tsx index 2982659ef..45b049bcb 100644 --- a/apps/antalmanac/src/routes/ErrorPage.tsx +++ b/apps/antalmanac/src/routes/ErrorPage.tsx @@ -1,43 +1,61 @@ -import { Typography, Button, Stack } from '@mui/material'; -import { Link, useRouteError } from 'react-router-dom'; +import { ExpandMore } from '@mui/icons-material'; +import { Box, Accordion, AccordionDetails, AccordionSummary, Typography, Button, Stack } from '@mui/material'; +import { Link, useLocation, useRouteError } from 'react-router-dom'; export const ErrorPage = () => { const error = useRouteError(); + const location = useLocation(); return ( - - - Oops! Something went wrong. - - - - This error may be caused by your browser having an out of date version of AntAlmanac. - - - Try refreshing the page. If the error persists, please submit a{' '} - bug report with the provided error. + + + + Oops! Something went wrong. + + + This error may be caused by your browser having an out of date version of AntAlmanac. + + + Try refreshing the page. If the error persists, please submit a{' '} + bug report with the provided error. + + + + + + + }> + View Error Message + + + Route: {location.pathname} + + {error instanceof Error ? error.stack : 'No error stack provided.'} + + + - - - -
- View Error Message -

{error instanceof Error &&

{error.stack}
}

-
-
+ ); };