Skip to content

Commit

Permalink
Merge pull request #13 from reciperium/fix/error-msg
Browse files Browse the repository at this point in the history
fix: improve error message
  • Loading branch information
woile authored Nov 6, 2024
2 parents 0ccb166 + 2dcb495 commit 1e82c92
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/recp/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ fn main() {
for recipe_path in recipes {
let content =
fs::read_to_string(recipe_path).expect("Could not read the given file");
let recipe = Recipe::try_from(content.as_str()).expect("Failed parsing the recipe");
let recipe = Recipe::try_from(content.as_str());
if let Err(error) = recipe {
eprintln!("Failed to parse the recipe file:\n\n{}", error);
std::process::exit(1);
}
let recipe = recipe.unwrap();
if let Some(name) = recipe.name {
println!("{}\n", style(name.to_title_case()).bold().blue());
}
Expand Down

0 comments on commit 1e82c92

Please sign in to comment.