mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
catch scripts taht end too early
This commit is contained in:
parent
b57ac45698
commit
009bae5870
@ -1,3 +1,4 @@
|
|||||||
|
import { WorkerScript } from "./Netscript/WorkerScript";
|
||||||
import { isScriptErrorMessage } from "./NetscriptEvaluator";
|
import { isScriptErrorMessage } from "./NetscriptEvaluator";
|
||||||
import { dialogBoxCreate } from "./ui/React/DialogBox";
|
import { dialogBoxCreate } from "./ui/React/DialogBox";
|
||||||
|
|
||||||
@ -13,6 +14,11 @@ export function setupUncaughtPromiseHandler(): void {
|
|||||||
msg += "<br>";
|
msg += "<br>";
|
||||||
msg += errorMsg;
|
msg += errorMsg;
|
||||||
dialogBoxCreate(msg);
|
dialogBoxCreate(msg);
|
||||||
|
} else if (e.reason instanceof WorkerScript) {
|
||||||
|
const msg =
|
||||||
|
`UNCAUGHT PROMISE ERROR<br>You forgot to await a promise<br>${e.reason.name}@${e.reason.hostname}<br>` +
|
||||||
|
`Maybe hack / grow / weaken ?`;
|
||||||
|
dialogBoxCreate(msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user