throw "string" -> throw new Error("string"

This commit is contained in:
2020-09-16 17:37:22 +00:00
parent 3dc5f8134c
commit f67379f83f
31 changed files with 195 additions and 151 deletions

View File

@@ -205,7 +205,7 @@ export default {
let res = await window.$gz.api.get("license/database-empty");
//We never expect there to be no data here
if (!res.hasOwnProperty("data")) {
throw res;
throw new Error(res);
}
if (res.data != true) {
let dialogResult = await window.$gz.dialog.confirmGeneric(
@@ -235,7 +235,7 @@ export default {
`trial/seed/${vm.obj.seedLevel}/${vm.obj.timeZoneOffset}`
);
if (jobId.error) {
throw jobId.error;
throw new Error(jobId.error);
}
jobId = jobId.jobId; //it's in a sub key
//indicate loading by setting on button
@@ -262,11 +262,11 @@ export default {
`job-operations/status/${jobId}`
);
if (jobStatus.error) {
throw jobStatus.error;
throw new Error(jobStatus.error);
}
jobStatus = jobStatus.data;
if (jobStatus == 4 || jobStatus == 0) {
throw "Seeding job failed";
throw new Error("Seeding job failed");
}
if (jobStatus == 3) {
vm.seedingJobActive = false;