diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2019-12-19 21:04:14 -0800 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-12-20 00:04:14 -0500 |
commit | 9ef0b18eb0b4c337ccfc8d0add36bec6b657262f (patch) | |
tree | 62bc08da0245b8fd7f350480c3ad94319457a7be /cli/lib.rs | |
parent | fcae4a7c0dc74701f3b1919bfd76cfdc1a0321ed (diff) |
repl: do not crash on async op reject (#3527)
Diffstat (limited to 'cli/lib.rs')
-rw-r--r-- | cli/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/lib.rs b/cli/lib.rs index df4cbbdf0..b191d5e87 100644 --- a/cli/lib.rs +++ b/cli/lib.rs @@ -349,6 +349,11 @@ fn bundle_command(flags: DenoFlags) { fn run_repl(flags: DenoFlags) { let (mut worker, _state) = create_worker_and_state(flags); + // Make repl continue to function under uncaught async errors. + worker.set_error_handler(Box::new(|err| { + eprintln!("{}", err.to_string()); + Ok(()) + })); // Setup runtime. js_check(worker.execute("denoMain()")); let main_future = async move { |