From 17a3f77733a0dd2ea6b31bddbde9671c264e3045 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 11 Jul 2025 18:47:31 -0400 Subject: [PATCH] add some more error handling --- src/main.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index b40aba6..055ef07 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,7 +42,14 @@ fn init_rootfs() { for (src, target, fstype, flags, data) in args { match system::syscall::mount(src, target, fstype, flags, Some(data)) { Ok(())=> eprintln!("Mounted {target}"), - Err(e)=> eprintln!("Bad mount: {e}"), + Err(e)=> { + eprintln!("Error: {e}"); + let mut opt = Some(&e as &dyn std::error::Error); + while let Some(current_source) = opt { + eprintln!("Caused by: {current_source}"); + opt = current_source.source(); + } + }, } } } @@ -52,7 +59,7 @@ fn init() -> Result<()> { init_rootfs(); - init_console(); + init_console()?; platform::aws::Aws.init().unwrap(); std::thread::sleep(std::time::Duration::from_secs(500));