diff --git a/app/components/FourOhFour.tsx b/app/components/FourOhFour.tsx index dee574d..9e98da6 100644 --- a/app/components/FourOhFour.tsx +++ b/app/components/FourOhFour.tsx @@ -3,21 +3,12 @@ import { Link, isRouteErrorResponse, useRouteError } from "@remix-run/react"; export default function FourOhFour() { const error = useRouteError(); - // Default errors - let status = 500; - let message = - "Something wen't wrong! Please sign out, back in, and give it another try!"; - // If error response is sent, use correct errors if (isRouteErrorResponse(error)) { - message = error.statusText; - status = error.status; - } - - return ( - -

Error {status}

-

{message}

+ return ( + +

Error {error.status}

+

{error.statusText}

If you believe you reached this page in error, please file an issue{" "} - ); + ); + } else if (error instanceof Error) { + return ( + +

Error 500

+

+ If you believe you reached this page in error, please file an issue{" "} + + here + +

+ + Back to Home + + + ); + } else { + return( + +

Error {error.status}

+

{error.statusText}

+

+ If you believe you reached this page in error, please file an issue{" "} + + here + +

+ + Back to Home + +
) + } }