Starting to use more advanced error output

This commit is contained in:
greg 2019-05-15 03:32:57 -07:00
parent 4ebf7fe879
commit 94ea7bcd09
1 changed files with 10 additions and 4 deletions

View File

@ -189,14 +189,20 @@ impl Repl {
};
let ref mut language_state = self.get_cur_language_state();
let response = language_state.run_computation(request);
let ComputationResponse { main_output, global_output_stats, debug_responses }
= language_state.run_computation(request);
self.handle_computation_response(response)
}
match main_output {
fn handle_computation_response(&mut self, response: ComputationResponse) -> String {
let mut buf = String::new();
buf.push_str(&match response.main_output {
Ok(s) => s,
Err(e) => format!("{} {}", "Error".red(), e)
}
});
buf
}
fn get_directives(&mut self) -> CommandTree {