From 065c68e7943bd26e9b889704f04f874766defb1d Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Fri, 27 May 2022 22:23:11 +0300 Subject: [PATCH] Catcher handle arbitrary status code --- app/components/Catcher.tsx | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/app/components/Catcher.tsx b/app/components/Catcher.tsx index e48e1e26b..ae3f2438a 100644 --- a/app/components/Catcher.tsx +++ b/app/components/Catcher.tsx @@ -10,15 +10,10 @@ export function Catcher() { switch (caught.status) { case 401: return ( -
-

401 Unauthorized

+
+

Error 401 Unauthorized

{user ? ( -

- If you need assistance you can ask for help on{" "} - - our Discord - -

+ ) : (

@@ -32,4 +27,21 @@ export function Catcher() {

); } + + return ( +
+

Error {caught.status}

+ {caught.data ? {JSON.stringify(caught.data, null, 2)} : null} + +
+ ); +} + +function GetHelp() { + return ( +

+ If you need assistance you can ask for help on{" "} + our Discord +

+ ); }