From d5a53dbe35d9d03aac0332b1811277381eb0c19f Mon Sep 17 00:00:00 2001 From: Atridad Lahiji <88056492+atridadl@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:36:53 -0700 Subject: [PATCH] ??? --- app/components/FourOhFour.tsx | 64 +++++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 14 deletions(-) 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 + +
) + } }