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

@ -20,6 +20,7 @@ use nu_protocol::{
Spanned, Value,
ast::{Math, Operator},
engine::Closure,
shell_error,
};
use serde::{Deserialize, Serialize};
use std::{
@ -87,7 +88,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",

View File

@ -190,11 +190,7 @@ impl PersistentPlugin {
// Start the plugin garbage collector
let gc = PluginGc::new(mutable.gc_config.clone(), &self).map_err(|err| {
IoError::new_internal(
err.kind(),
"Could not start plugin gc",
nu_protocol::location!(),
)
IoError::new_internal(err, "Could not start plugin gc", nu_protocol::location!())
})?;
let pid = child.id();