Skip to content

Commit

Permalink
Print error message and exit instead of panic for invalid tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkassimo committed Aug 12, 2019
1 parent 9bd473d commit e28e7b5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cli/main.rs
Expand Up @@ -113,10 +113,17 @@ fn create_worker_and_state(
s.status(status, msg).expect("shell problem");
}
});
// TODO(kevinkassimo): maybe make include_deno_namespace also configurable?
let state =
ThreadSafeState::new(flags, argv, ops::op_selector_std, progress, true)
.unwrap();
let state = {
// TODO(kevinkassimo): maybe make include_deno_namespace also configurable?
let maybe_state =
ThreadSafeState::new(flags, argv, ops::op_selector_std, progress, true);
if let Err(e) = maybe_state {
// Just exit, as this is only called on Deno startup.
eprintln!("Failed to start Deno: {}", &e);
std::process::exit(1);
}
maybe_state.unwrap()
};
let worker = Worker::new(
"main".to_string(),
startup_data::deno_isolate_init(),
Expand Down

0 comments on commit e28e7b5

Please sign in to comment.