add some more error handling

This commit is contained in:
Ryan Heywood 2025-07-11 18:47:31 -04:00
parent b3fe5e23f4
commit 17a3f77733
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
1 changed files with 9 additions and 2 deletions

View File

@ -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));