diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-08-07 22:47:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-07 16:47:18 -0400 |
commit | 59ca66a207ceb4699e1322ce22f953ac0f124f13 (patch) | |
tree | 775b30b9a46f3c824d97060fb147336ecb6b83b7 /cli/tsc/99_main_compiler.js | |
parent | 479164d287604d079f6342e656f2ac95b109367f (diff) |
Encode op errors as strings instead of numbers (#6977)
Diffstat (limited to 'cli/tsc/99_main_compiler.js')
-rw-r--r-- | cli/tsc/99_main_compiler.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index 41051f2e0..23e25237a 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -23,6 +23,7 @@ delete Object.prototype.__proto__; const dispatchJson = window.__bootstrap.dispatchJson; const util = window.__bootstrap.util; const errorStack = window.__bootstrap.errorStack; + const errors = window.__bootstrap.errors.errors; function opNow() { const res = dispatchJson.sendSync("op_now"); @@ -1851,6 +1852,27 @@ delete Object.prototype.__proto__; throw new Error("Worker runtime already bootstrapped"); } hasBootstrapped = true; + core.registerErrorClass("NotFound", errors.NotFound); + core.registerErrorClass("PermissionDenied", errors.PermissionDenied); + core.registerErrorClass("ConnectionRefused", errors.ConnectionRefused); + core.registerErrorClass("ConnectionReset", errors.ConnectionReset); + core.registerErrorClass("ConnectionAborted", errors.ConnectionAborted); + core.registerErrorClass("NotConnected", errors.NotConnected); + core.registerErrorClass("AddrInUse", errors.AddrInUse); + core.registerErrorClass("AddrNotAvailable", errors.AddrNotAvailable); + core.registerErrorClass("BrokenPipe", errors.BrokenPipe); + core.registerErrorClass("AlreadyExists", errors.AlreadyExists); + core.registerErrorClass("InvalidData", errors.InvalidData); + core.registerErrorClass("TimedOut", errors.TimedOut); + core.registerErrorClass("Interrupted", errors.Interrupted); + core.registerErrorClass("WriteZero", errors.WriteZero); + core.registerErrorClass("UnexpectedEof", errors.UnexpectedEof); + core.registerErrorClass("BadResource", errors.BadResource); + core.registerErrorClass("Http", errors.Http); + core.registerErrorClass("URIError", URIError); + core.registerErrorClass("TypeError", TypeError); + core.registerErrorClass("Other", Error); + core.registerErrorClass("Busy", errors.Busy); globalThis.__bootstrap = undefined; runtimeStart("TS"); } |