Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/build/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ pub enum BuildError {
#[error("Failed to extract content from path, err: '{0}'")]
FailedToExtractContent(io::Error),

#[error("Failed to parse source '{path}': {error}")]
SourceParse { path: PathBuf, error: String },

#[error("Failed to generate file: {0}")]
GenerationFailed(String),

Expand Down
7 changes: 6 additions & 1 deletion crates/build/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ impl ArtifactsResolver {
match parse::Program::parse_from_str(&content) {
Ok(program) if Self::rec_main_checker(program.items(), &FunctionName::main()) => paths.push(path),
Ok(_) => {}
Err(error) => eprintln!("warning: skipping '{}' as it doesn't parse: {error}", path.display()),
Err(error) => {
return Err(BuildError::SourceParse {
path,
error: error.to_string(),
});
}
}
}

Expand Down
Loading