Skip to content

Commit

Permalink
Try to stringify router error object
Browse files Browse the repository at this point in the history
  • Loading branch information
pkirilin committed Mar 13, 2024
1 parent 83fc3e6 commit 8247ebf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/frontend/src/pages/ui/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { Link as RouterLink, useRouteError } from 'react-router-dom';
import { ErrorLayout } from '@/widgets/layout';

export const ErrorPage: FC = () => {
const error = useRouteError() as Error;
const error = useRouteError();

useEffect(() => {
// eslint-disable-next-line no-console
console.error(error);
console.error(JSON.stringify(error));
}, [error]);

return (
Expand All @@ -19,7 +19,7 @@ export const ErrorPage: FC = () => {
<Typography paragraph>
Sorry, the page you are looking for does not exist, or an unexpected error has occurred
</Typography>
{error.message && <Typography paragraph>Error message: {error.message}</Typography>}
{/* {error.message && <Typography paragraph>Error message: {error.message}</Typography>} */}
<Link component={RouterLink} to="/">
Return to home
</Link>
Expand Down

0 comments on commit 8247ebf

Please sign in to comment.