mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
Add path to error message when trying to read directory
This commit is contained in:
parent
53c21d09b7
commit
ce70fce3b2
1 changed files with 10 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue