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

@@ -32,13 +32,13 @@ export default {
);
if (res.error) {
throw res.error;
throw new Error(res.error);
}
if (res.data) {
tid.inside = res.data;
}
} catch (e) {
throw e;
throw new Error(e);
}
})();
}
@@ -69,14 +69,14 @@ export default {
let res = await window.$gz.api.get("attachment/parent/" + tid.id);
if (res.error) {
throw res.error;
throw new Error(res.error);
}
if (res.data.id && res.data.id != 0) {
this.handleOpenObjectClick(vm, res.data);
return;
}
} catch (e) {
throw e;
throw new Error(e);
}
})();
@@ -115,7 +115,7 @@ export default {
);
if (res.error) {
throw res.error;
throw new Error(res.error);
}
if (res && res.data) {
vm.$router.push({
@@ -125,7 +125,7 @@ export default {
return;
}
} catch (e) {
throw e;
throw new Error(e);
}
})();