This commit is contained in:
@@ -121,20 +121,10 @@ export default {
|
||||
return Promise.resolve(response);
|
||||
}
|
||||
},
|
||||
statusEx(response, isLogin = false) {
|
||||
statusEx(response) {
|
||||
//Handle expected api errors
|
||||
if (response.status == 401) {
|
||||
if (!isLogin) {
|
||||
throw new Error("LT:ErrorUserNotAuthenticated");
|
||||
} else {
|
||||
if (
|
||||
response.statusText.includes("License agreement consent required")
|
||||
) {
|
||||
throw new Error(response.statusText);
|
||||
} else {
|
||||
throw new Error("LT:ErrorUserNotAuthenticated"); //bad login or password
|
||||
}
|
||||
}
|
||||
throw new Error("LT:ErrorUserNotAuthenticated");
|
||||
}
|
||||
|
||||
if (response.status == 403) {
|
||||
@@ -465,7 +455,7 @@ export default {
|
||||
}
|
||||
|
||||
let r = await fetch(that.APIUrl(route), fetchOptions);
|
||||
that.statusEx(r, isLogin);
|
||||
that.statusEx(r);
|
||||
r = await that.extractBodyEx(r);
|
||||
return r;
|
||||
} catch (error) {
|
||||
@@ -473,6 +463,7 @@ export default {
|
||||
handleError("UPSERT", error, route);
|
||||
} else {
|
||||
//specifically this is for the login page
|
||||
console.log("upser error is: ", error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(error));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user