From 0af5a134457ea7ac843ebca3fe4cd4975787b26f Mon Sep 17 00:00:00 2001 From: Petard Jonson <41122242+greenhat616@users.noreply.github.com> Date: Mon, 22 Jul 2024 00:02:07 +0800 Subject: [PATCH] fix(core): exit with no success should not be a error --- nyanpasu-utils/src/core/instance.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/nyanpasu-utils/src/core/instance.rs b/nyanpasu-utils/src/core/instance.rs index 5eb8ade..15d31df 100644 --- a/nyanpasu-utils/src/core/instance.rs +++ b/nyanpasu-utils/src/core/instance.rs @@ -270,14 +270,10 @@ impl CoreInstance { instance.kill()?; loop { if let Some(state) = instance.try_wait()? { - if state.success() { - break; - } else { - return Err(CoreInstanceError::Io(std::io::Error::new( - std::io::ErrorKind::Other, - format!("Failed to kill instance: {:?}", state), - ))); + if !state.success() { + tracing::warn!("instance terminated with error: {:?}", state); } + break; } std::thread::sleep(std::time::Duration::from_millis(10)); }