Abhinav-grd 4 vuotta sitten
vanhempi
commit
ca81f764e5
2 muutettua tiedostoa jossa 11 lisäystä ja 12 poistoa
  1. 10 11
      src/utils/common/errorUtil.ts
  2. 1 1
      src/utils/common/utilFunctions.ts

+ 10 - 11
src/utils/common/errorUtil.ts

@@ -5,15 +5,14 @@ export const errorCodes = {
 };
 
 export function ErrorHandler(error) {
-    if (error.res)
-        if (
-            error.response?.status.toString() ==
-                errorCodes.ERR_STORAGE_LIMIT_EXCEEDED ||
-            error.response?.status.toString() ==
-                errorCodes.ERR_NO_ACTIVE_SUBSCRIPTION
-        ) {
-            throw new Error(error.response.status);
-        } else {
-            return;
-        }
+    if (
+        error.response?.status.toString() ==
+            errorCodes.ERR_STORAGE_LIMIT_EXCEEDED ||
+        error.response?.status.toString() ==
+            errorCodes.ERR_NO_ACTIVE_SUBSCRIPTION
+    ) {
+        throw new Error(error.response.status);
+    } else {
+        return;
+    }
 }

+ 1 - 1
src/utils/common/utilFunctions.ts

@@ -1,4 +1,4 @@
-import errorCodes from './errorUtil';
+import {errorCodes} from './errorUtil';
 
 export function checkConnectivity() {
     if (navigator.onLine) {