mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Convert more ShellError variants to named fields (#11173)
# Description Convert these ShellError variants to named fields: * CreateNotPossible * MoveNotPossibleSingle * DirectoryNotFoundCustom * DirectoryNotFound * NotADirectory * OutOfMemoryError * PermissionDeniedError * IOErrorSpanned * IOError * IOInterrupted Also place the `span` field of `DirectoryNotFound` last to match other errors. Part of #10700 (almost half done!) # User-Facing Changes None # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting N/A
This commit is contained in:
@ -110,10 +110,14 @@ impl Command for Mktemp {
|
||||
};
|
||||
|
||||
let res = match uu_mktemp::mktemp(&options) {
|
||||
Ok(res) => res
|
||||
.into_os_string()
|
||||
.into_string()
|
||||
.map_err(|e| ShellError::IOErrorSpanned(e.to_string_lossy().to_string(), span))?,
|
||||
Ok(res) => {
|
||||
res.into_os_string()
|
||||
.into_string()
|
||||
.map_err(|e| ShellError::IOErrorSpanned {
|
||||
msg: e.to_string_lossy().to_string(),
|
||||
span,
|
||||
})?
|
||||
}
|
||||
Err(e) => {
|
||||
return Err(ShellError::GenericError(
|
||||
format!("{}", e),
|
||||
|
Reference in New Issue
Block a user