From c7e1f8fabdc87d3622fd94769c57197d5dfecad3 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sun, 14 Apr 2019 16:07:24 -0400 Subject: Fix silent error, add custom panic handler (#2098) This is to work around Tokio's panic recovery feature. Ref https://github.com/tokio-rs/tokio/issues/495 Ref https://github.com/tokio-rs/tokio/issues/209 Ref https://github.com/denoland/deno/issues/1311 Fixes #2097 --- cli/compiler.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cli/compiler.rs') diff --git a/cli/compiler.rs b/cli/compiler.rs index fa59e8a8c..ae4e3419f 100644 --- a/cli/compiler.rs +++ b/cli/compiler.rs @@ -111,6 +111,8 @@ fn lazy_start(parent_state: ThreadSafeState) -> ResourceId { let mut runtime = C_RUNTIME.lock().unwrap(); runtime.spawn(lazy(move || { + tokio_util::abort_on_panic(); + worker.then(move |result| -> Result<(), ()> { // Close resource so the future created by // handle_worker_message_stream exits -- cgit v1.2.3