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

@@ -203,7 +203,7 @@ export default {
//call seed route
let jobId = await window.$gz.api.upsert("attachment/maintenance");
if (jobId.error) {
throw jobId.error;
throw new Error(jobId.error);
}
jobId = jobId.jobId; //it's in a sub key
vm.jobActive = true;
@@ -229,11 +229,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.jobActive = false;