Skip to content

Commit

Permalink
update error output for parsing failures
Browse files Browse the repository at this point in the history
  • Loading branch information
darrell-roberts committed Nov 12, 2024
1 parent 554de64 commit 57166ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ fn check_parse_errors(parsed_crates: &BTreeMap<CrateName, ParsedData>) -> anyhow
errors_encountered = true;
for error in &data.errors {
error!(
"Parsing error: \"{}\" in crate \"{}\" for file \"{}\"",
error.error, error.crate_name, error.file_name
"Parsing error: \"{}\" in file \"{}\"",
error.error, error.file_name
);
}
}
Expand Down
2 changes: 0 additions & 2 deletions core/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ pub enum ParseError {
/// Error with it's related data.
#[derive(Debug)]
pub struct ErrorInfo {
/// The crate where this error occurred.
pub crate_name: CrateName,
/// The file name being parsed.
pub file_name: String,
/// The parse error.
Expand Down
3 changes: 1 addition & 2 deletions core/src/visitors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ impl<'a> TypeShareVisitor<'a> {
match result {
Ok(data) => self.parsed_data.push(data),
Err(error) => self.parsed_data.errors.push(ErrorInfo {
crate_name: self.parsed_data.crate_name.clone(),
file_name: self.parsed_data.file_name.clone(),
file_name: self.file_path.to_string_lossy().into_owned(),
error,
}),
}
Expand Down

0 comments on commit 57166ca

Please sign in to comment.