From 308710d670027b751e9159ce7ecf6330500bc848 Mon Sep 17 00:00:00 2001 From: jainvedant392 Date: Sat, 16 Dec 2023 16:06:35 +0530 Subject: [PATCH] modify handleResponse.ts --- src/Utils/request/handleResponse.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Utils/request/handleResponse.ts b/src/Utils/request/handleResponse.ts index aefe43e5fce..c1139af141d 100644 --- a/src/Utils/request/handleResponse.ts +++ b/src/Utils/request/handleResponse.ts @@ -12,21 +12,14 @@ export default function handleResponse( return; } - // 5xx errors - if (res.status >= 500 && res.status < 600) { - console.error("Server error", res); - notify?.Error({ msg: error?.detail || "Something went wrong...!" }); - return; - } - // 400/406 Bad Request if (res.status === 400 || res.status === 406) { notify?.BadRequest({ errs: error }); return; } - // Other 400 Errors - if (res.status >= 400) { + // Other Errors between 400-599 (inclusive) + if (res.status >= 400 && res.status < 600) { // Invalid token if (!silent && error?.code === "token_not_valid") { navigate(`/session-expired?redirect=${window.location.href}`);