From 44775ec0bae3d5b7656ce197ffb885fdb74797dc Mon Sep 17 00:00:00 2001 From: liuxu Date: Tue, 17 Dec 2024 11:11:12 +0800 Subject: [PATCH] logfix:print warn instead of error when dir not found. Signed-off-by: liuxu --- vmm/sandbox/src/sandbox.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vmm/sandbox/src/sandbox.rs b/vmm/sandbox/src/sandbox.rs index 42875a8e..e86568ef 100644 --- a/vmm/sandbox/src/sandbox.rs +++ b/vmm/sandbox/src/sandbox.rs @@ -90,8 +90,13 @@ where let mut subs = match tokio::fs::read_dir(dir).await { Ok(subs) => subs, Err(e) => { - error!("FATAL! read working dir {} for recovery: {}", dir, e); - return; + if e.kind() == ErrorKind::NotFound { + warn!("WARN! read working dir {} for recovery: No such file or directory", dir); + return; + } else { + error!("FATAL! read working dir {} for recovery: {}", dir, e); + return; + } } }; while let Some(entry) = subs.next_entry().await.unwrap() {