diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-04-14 16:07:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-14 16:07:24 -0400 |
commit | c7e1f8fabdc87d3622fd94769c57197d5dfecad3 (patch) | |
tree | 9942097cdbba11f2af002208a2ef70f1f196b594 /cli/compiler.rs | |
parent | b413cd5afd6b74b3e50bf6dbb5972ea7df9f34fd (diff) |
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
Diffstat (limited to 'cli/compiler.rs')
-rw-r--r-- | cli/compiler.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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 |