diff options
author | Luca Casonato <lucacasonato@yahoo.com> | 2021-02-25 20:06:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-25 20:06:06 +0100 |
commit | 975705a64911b0ced8ddf18985b49d86e4f35e51 (patch) | |
tree | 8facc49c3ed9479f8e2dc23404997aaf5a11cdd4 /runtime/js | |
parent | aa47f8186cbc068232e23b92a6966be9bd23e4bb (diff) |
chore(core): optional args for registerErrorClass (#9602)
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/10_dispatch_minimal.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/js/10_dispatch_minimal.js b/runtime/js/10_dispatch_minimal.js index 4d6af6fc3..e74f8c393 100644 --- a/runtime/js/10_dispatch_minimal.js +++ b/runtime/js/10_dispatch_minimal.js @@ -51,13 +51,13 @@ function unwrapResponse(res) { if (res.err != null) { - const ErrorClass = core.getErrorClass(res.err.className); + const [ErrorClass, args] = core.getErrorClassAndArgs(res.err.className); if (!ErrorClass) { throw new Error( `Unregistered error class: "${res.err.className}"\n ${res.err.message}\n Classes of errors returned from ops should be registered via Deno.core.registerErrorClass().`, ); } - throw new ErrorClass(res.err.message); + throw new ErrorClass(res.err.message, ...args); } return res.result; } |