isExitStatus
isExitStatus(
err):boolean
Defined in: packages/runtime/src/wasm/exit-status.ts:36
Check if a thrown value is an Emscripten ExitStatus.
Emscripten’s exit() implementation throws an ExitStatus object (or, in some
builds, a bare Error whose message includes the string ExitStatus) to unwind
the JS stack after the program calls _Exit. This is normal program termination,
not a real error — callers should branch on this check rather than rethrowing.
Parameters
Section titled “Parameters”unknown
Any thrown value.
Returns
Section titled “Returns”boolean
true if the value looks like an Emscripten ExitStatus.
Example
Section titled “Example”try { module.callMain(args)} catch (e) { if (isExitStatus(e)) return getExitStatusCode(e) throw e}