Convert FileNotFoundCustom to named fields (#11123)

# Description

Part of #10700

# User-Facing Changes

None

# Tests + Formatting

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting

N/A
This commit is contained in:
Eric Hodel
2023-11-21 15:30:21 -08:00
committed by GitHub
parent 5ad7b8f029
commit e36f69bf3c
6 changed files with 49 additions and 39 deletions

View File

@ -59,10 +59,10 @@ fn read_in_file<'a>(
let working_set = StateWorkingSet::new(engine_state);
report_error(
&working_set,
&ShellError::FileNotFoundCustom(
format!("Could not read file '{}': {:?}", file_path, e.to_string()),
Span::unknown(),
),
&ShellError::FileNotFoundCustom {
msg: format!("Could not read file '{}': {:?}", file_path, e.to_string()),
span: Span::unknown(),
},
);
std::process::exit(1);
});