diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2020-12-22 18:01:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-22 18:01:07 +0100 |
commit | d77452c79ffe46074f151f6b9554e6c0e0bd2954 (patch) | |
tree | ad33e8a3775c9bf0b7834e58e3d47a14a5c75871 /core/examples/http_bench_json_ops.js | |
parent | d199e45ad5dd180a6969abcd528023e173a1e1ff (diff) |
core: fix http_bench_json_ops, register Error (#8860)
Fixes the following runtime error for me when benchmarking:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err`
value: Error: Unregistered error class: "Error"
Connection reset by peer (os error 104)
Classes of errors returned from ops should be registered via
Deno.core.registerErrorClass().
at processResponse (deno:core/core.js:219:13)
at Object.jsonOpAsync (deno:core/core.js:240:12)
at async read (http_bench_json_ops.js:29:21)
at async serve (http_bench_json_ops.js:45:19)',
core/examples/http_bench_json_ops.rs:260:28
Diffstat (limited to 'core/examples/http_bench_json_ops.js')
-rw-r--r-- | core/examples/http_bench_json_ops.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/examples/http_bench_json_ops.js b/core/examples/http_bench_json_ops.js index 3a5dd05c5..aba7da432 100644 --- a/core/examples/http_bench_json_ops.js +++ b/core/examples/http_bench_json_ops.js @@ -57,6 +57,7 @@ async function serve(rid) { async function main() { Deno.core.ops(); + Deno.core.registerErrorClass("Error", Error); const listenerRid = listen(); Deno.core.print(`http_bench_json_ops listening on http://127.0.0.1:4544/\n`); |