throw "string" -> throw new Error("string"
This commit is contained in:
@@ -57,7 +57,7 @@ function handleError(action, error, route) {
|
||||
);
|
||||
router.push(window.$gz.store.state.homePage);
|
||||
|
||||
throw "[ErrorUserNotAuthorized]";
|
||||
throw new Error("[ErrorUserNotAuthorized]");
|
||||
}
|
||||
|
||||
//Handle 401 not authenticated
|
||||
@@ -73,7 +73,7 @@ function handleError(action, error, route) {
|
||||
|
||||
router.push("/login");
|
||||
|
||||
throw "[ErrorUserNotAuthenticated]";
|
||||
throw new Error("[ErrorUserNotAuthenticated]");
|
||||
}
|
||||
|
||||
//is it a network error?
|
||||
@@ -98,7 +98,7 @@ function handleError(action, error, route) {
|
||||
window.$gz.eventBus.$emit("notify-error", msg);
|
||||
//note: using translation key in square brackets
|
||||
|
||||
throw msg;
|
||||
throw new Error(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@ export default {
|
||||
handleError("UPSERT", error, route);
|
||||
} else {
|
||||
//specifically this is for the login page
|
||||
throw error;
|
||||
throw new Error(error);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -663,11 +663,13 @@ export default {
|
||||
|
||||
let res = await window.$gz.api.upsert("report/render", reportDataOptions);
|
||||
if (res.error) {
|
||||
throw res.error;
|
||||
throw new Error(res.error);
|
||||
} else {
|
||||
let reportUrl = window.$gz.api.reportDownloadUrl(res.data);
|
||||
if (window.open(reportUrl, "Report") == null) {
|
||||
throw "Problem displaying report in new window. Browser must allow pop-ups to view reports; check your browser setting";
|
||||
throw new Error(
|
||||
"Problem displaying report in new window. Browser must allow pop-ups to view reports; check your browser setting"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user