From d77452c79ffe46074f151f6b9554e6c0e0bd2954 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 22 Dec 2020 18:01:07 +0100 Subject: 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 --- core/examples/http_bench_json_ops.js | 1 + 1 file changed, 1 insertion(+) (limited to 'core/examples/http_bench_json_ops.js') 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`); -- cgit v1.2.3