mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
Encode op errors as strings instead of numbers (#6977)
This commit is contained in:
parent
479164d287
commit
59ca66a207
14 changed files with 197 additions and 293 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue