diff options
Diffstat (limited to 'core/core.js')
-rw-r--r-- | core/core.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/core.js b/core/core.js index 8e06a3e45..9ce563869 100644 --- a/core/core.js +++ b/core/core.js @@ -132,6 +132,23 @@ opSync("op_print", str, isErr); } + // Some "extensions" rely on "BadResource" and "Interrupted" errors in the + // JS code (eg. "deno_net") so they are provided in "Deno.core" but later + // reexported on "Deno.errors" + class BadResource extends Error { + constructor(msg) { + super(msg); + this.name = "BadResource"; + } + } + + class Interrupted extends Error { + constructor(msg) { + super(msg); + this.name = "Interrupted"; + } + } + // Provide bootstrap namespace window.__bootstrap = {}; // Extra Deno.core.* exports @@ -146,5 +163,7 @@ registerErrorClass, handleAsyncMsgFromRust, syncOpsCache, + BadResource, + Interrupted, }); })(this); |