mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +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 error = std::io::Error::from(error);
|
||||||
let formatted = format!("{}", error);
|
let formatted = format!("{}", error);
|
||||||
let doc = alloc.concat([
|
let doc = alloc.stack([
|
||||||
alloc.reflow(r"I tried to read this file, but ran into a "),
|
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.text(formatted),
|
||||||
alloc.reflow(r" problem."),
|
alloc.reflow(r" problem."),
|
||||||
|
])
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Report {
|
Report {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue