Skip to content

Commit

Permalink
produce error when grammar build fails
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalkuthe committed Apr 17, 2023
1 parent 11dea39 commit 29e6f7c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helix-loader/src/grammar.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use anyhow::{anyhow, Context, Result};
use anyhow::{anyhow, bail, Context, Result};
use serde::{Deserialize, Serialize};
use std::fs;
use std::time::SystemTime;
Expand Down Expand Up @@ -178,10 +178,10 @@ pub fn build_grammars(target: Option<String>) -> Result<()> {

if !errors.is_empty() {
let len = errors.len();
println!("{} grammars failed to build", len);
for (i, error) in errors.into_iter().enumerate() {
println!("\tFailure {}/{}: {}", i, len, error);
println!("Failure {}/{}: {}", i, len, error);
}
bail!("{} grammars failed to build", len);
}

Ok(())
Expand Down

0 comments on commit 29e6f7c

Please sign in to comment.