Skip to content

Commit 435b200

Browse files
authored
Merge pull request #302 from Timmmm/user/timh/missing_error_message
Add missing error message
2 parents 24f875f + eab4f0e commit 435b200

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/main.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,17 @@ fn print_parser_error(
353353
SvParserError::Preprocess(Some((path, pos))) => {
354354
printer.print_preprocess_error(&path, pos, oneline)?;
355355
}
356-
SvParserError::Include { source: x } => {
357-
if let SvParserError::File { path: x, .. } = *x {
358-
printer.print_error(&format!("failed to include '{}'", x.to_string_lossy()))?;
356+
SvParserError::Include { source } => match *source {
357+
SvParserError::File { source: _, path } => {
358+
printer.print_error(&format!("failed to include '{}'", path.display()))?;
359359
}
360-
}
360+
SvParserError::DefineNotFound(define) => {
361+
printer.print_error(&format!("definition not found for '{}'", define))?;
362+
}
363+
_ => {
364+
printer.print_error(&format!("{}", source))?;
365+
}
366+
},
361367
SvParserError::ReadUtf8(path) => {
362368
printer.print_error(&format!("file '{}' is not valid UTF-8", path.display()))?;
363369
}

0 commit comments

Comments
 (0)