[chore] remove some code smells

This commit is contained in:
MathieuG-P
2023-07-16 17:40:19 +02:00
parent 4963c44e15
commit 6bf26edae5
5 changed files with 5 additions and 8 deletions
@@ -49,7 +49,7 @@ export default function OneClickDownloadMap() {
progressBar.complete();
if (!res) {
throw "Failed to download map with OneClick";
throw new Error("Failed to download map with OneClick");
}
await timer(300).toPromise();
@@ -40,7 +40,7 @@ export default function OneClickDownloadModel() {
const model = await modelSaber.getModelById(infos.data.id);
if (!model) {
throw "Failed to get model from ModelSaber";
throw new Error("Failed to get model from ModelSaber");
}
setModel(() => model);
@@ -50,7 +50,7 @@ export default function OneClickDownloadModel() {
const res = await modelDownloader.oneClickInstallModel(model);
if (!res) {
throw "Failed to download model";
throw new Error("Failed to download model");
}
})();
@@ -65,7 +65,7 @@ export default function OneClickDownloadModel() {
promise.finally(() => {
windows.close("oneclick-download-model.html")
});
}, []);
return (