Add path to error message when trying to read directory

This commit is contained in:
rezzaghi 2022-09-23 11:01:00 -03:00
parent 53c21d09b7
commit ce70fce3b2
No known key found for this signature in database
GPG Key ID: 867424F73B0B4F02

View File

@ -5642,10 +5642,16 @@ fn to_file_problem_report(filename: &Path, error: io::ErrorKind) -> String {
_ => {
let error = std::io::Error::from(error);
let formatted = format!("{}", error);
let doc = alloc.concat([
alloc.reflow(r"I tried to read this file, but ran into a "),
alloc.text(formatted),
alloc.reflow(r" problem."),
let doc = alloc.stack([
alloc.reflow(r"I tried to read this file:"),
alloc
.parser_suggestion(filename.to_str().unwrap())
.indent(4),
alloc.concat([
alloc.reflow(r"But ran into a "),
alloc.text(formatted),
alloc.reflow(r" problem."),
])
]);
Report {