Propagate errors

This commit is contained in:
Maximilian Ammann 2022-10-30 19:54:40 +01:00
parent 5a61862008
commit 1ea049f995

View File

@ -121,7 +121,7 @@ const emitTypeScript = () => {
});
if (child.status !== 0) {
console.error("Failed to execute tsc")
throw new Error("Failed to execute tsc")
}
}
@ -154,7 +154,7 @@ const wasmPack = () => {
});
if (cargo.status !== 0) {
console.error("Failed to execute cargo build")
throw new Error("Failed to execute cargo build")
}
let wasmbindgen = spawnSync('wasm-bindgen', [
@ -170,7 +170,7 @@ const wasmPack = () => {
});
if (wasmbindgen.status !== 0) {
console.error("Failed to execute wasm-bindgen")
throw new Error("Failed to execute wasm-bindgen")
}
if (release) {
@ -186,10 +186,9 @@ const wasmPack = () => {
});
if (wasmOpt.status !== 0) {
console.error("Failed to execute wasm-opt")
throw new Error("Failed to execute wasm-opt")
}
}
}
const watchResult = async (result) => {
@ -260,4 +259,8 @@ const start = async () => {
emitTypeScript();
}
const _ = start()
try {
const _ = start()
} catch (e) {
console.log("Failed to start building: " + e.message)
}