Skip to content

Commit

Permalink
#4 changing up output
Browse files Browse the repository at this point in the history
  • Loading branch information
hlafaille committed Mar 14, 2024
1 parent 0e142e9 commit 3bf9c26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/frontend/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ use colored::*;
* This differs from panics as we want a nice, readable output for the user.
*/
pub fn print_err(msg: &str) {
eprintln!("{} {}", "[X]".red().bold(), msg.white());
let lines = msg.split("\n");
for line in lines {
if !line.is_empty() {
eprintln!("{} {}", "[X]".red().bold(), line.white());
}
}
exit(1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn get_contexts() -> (ProjectContext, ToolchainContext) {
let p_ctx = match get_project_context() {
Ok(v) => v,
Err(e) => {
print_err("Failed to get project context (Are you in an Espresso project?)");
print_err(format!("Failed to get project context! \nERROR MESSAGE: \n{}", e).as_str());
panic!("{}", e);
}
};
Expand Down

0 comments on commit 3bf9c26

Please sign in to comment.