mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 10:45:41 +02:00
Refactor: Construct IoError
from std::io::Error
instead of std::io::ErrorKind
(#15777)
This commit is contained in:
@ -10,7 +10,8 @@ use nu_utils::perf;
|
||||
use nu_plugin::{EvaluatedCall, PluginCommand};
|
||||
use nu_protocol::{
|
||||
Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Spanned,
|
||||
SyntaxShape, Type, Value, shell_error::io::IoError,
|
||||
SyntaxShape, Type, Value,
|
||||
shell_error::{self, io::IoError},
|
||||
};
|
||||
|
||||
use std::{fs::File, io::BufReader, num::NonZeroUsize, path::PathBuf, sync::Arc};
|
||||
@ -193,7 +194,7 @@ fn command(
|
||||
)),
|
||||
},
|
||||
None => Err(ShellError::Io(IoError::new_with_additional_context(
|
||||
std::io::ErrorKind::NotFound,
|
||||
shell_error::io::ErrorKind::from_std(std::io::ErrorKind::Other),
|
||||
spanned_file.span,
|
||||
PathBuf::from(spanned_file.item),
|
||||
"File without extension",
|
||||
|
@ -16,7 +16,8 @@ use log::debug;
|
||||
use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand};
|
||||
use nu_protocol::{
|
||||
Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Spanned,
|
||||
SyntaxShape, Type, shell_error::io::IoError,
|
||||
SyntaxShape, Type,
|
||||
shell_error::{self, io::IoError},
|
||||
};
|
||||
use polars::error::PolarsError;
|
||||
|
||||
@ -212,7 +213,7 @@ fn command(
|
||||
)),
|
||||
},
|
||||
None => Err(ShellError::Io(IoError::new_with_additional_context(
|
||||
std::io::ErrorKind::NotFound,
|
||||
shell_error::io::ErrorKind::FileNotFound,
|
||||
resource.span,
|
||||
Some(PathBuf::from(resource.path)),
|
||||
"File without extension",
|
||||
|
Reference in New Issue
Block a user