Refactor: Construct IoError from std::io::Error instead of std::io::ErrorKind (#15777)

This commit is contained in:
Piepmatz
2025-05-18 14:52:40 +02:00
committed by GitHub
parent c4dcfdb77b
commit 833471241a
80 changed files with 408 additions and 299 deletions

View File

@ -1048,7 +1048,7 @@ impl ForegroundGuard {
// This should always succeed, frankly, but handle the error just in case
setpgid(Pid::from_raw(0), Pid::from_raw(0)).map_err(|err| {
nu_protocol::shell_error::io::IoError::new_internal(
std::io::Error::from(err).kind(),
std::io::Error::from(err),
"Could not set pgid",
nu_protocol::location!(),
)

View File

@ -12,7 +12,7 @@ use nu_plugin_protocol::{
use nu_protocol::{
BlockId, ByteStreamType, Config, CustomValue, IntoInterruptiblePipelineData, LabeledError,
PipelineData, PluginSignature, ShellError, Signals, Span, Spanned, Value, VarId,
engine::Closure,
engine::Closure, shell_error,
};
use std::{
collections::HashMap,
@ -91,7 +91,7 @@ fn manager_consume_all_exits_after_streams_and_interfaces_are_dropped() -> Resul
fn test_io_error() -> ShellError {
ShellError::Io(IoError::new_with_additional_context(
std::io::ErrorKind::Other,
shell_error::io::ErrorKind::from_std(std::io::ErrorKind::Other),
Span::test_data(),
None,
"test io error",