diff options
Diffstat (limited to 'runtime/rt/40_signals.js')
-rw-r--r-- | runtime/rt/40_signals.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/runtime/rt/40_signals.js b/runtime/rt/40_signals.js index 739c963fd..091afd66a 100644 --- a/runtime/rt/40_signals.js +++ b/runtime/rt/40_signals.js @@ -3,6 +3,7 @@ ((window) => { const core = window.Deno.core; const { build } = window.__bootstrap.build; + const { errors } = window.__bootstrap.errors; function bindSignal(signo) { return core.jsonOpSync("op_signal_bind", { signo }); @@ -212,7 +213,15 @@ } #pollSignal = async () => { - const res = await pollSignal(this.#rid); + let res; + try { + res = await pollSignal(this.#rid); + } catch (error) { + if (error instanceof errors.BadResource) { + return true; + } + throw error; + } return res.done; }; |