add some more error handling
This commit is contained in:
parent
b3fe5e23f4
commit
17a3f77733
11
src/main.rs
11
src/main.rs
|
@ -42,7 +42,14 @@ fn init_rootfs() {
|
||||||
for (src, target, fstype, flags, data) in args {
|
for (src, target, fstype, flags, data) in args {
|
||||||
match system::syscall::mount(src, target, fstype, flags, Some(data)) {
|
match system::syscall::mount(src, target, fstype, flags, Some(data)) {
|
||||||
Ok(())=> eprintln!("Mounted {target}"),
|
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_rootfs();
|
||||||
|
|
||||||
init_console();
|
init_console()?;
|
||||||
|
|
||||||
platform::aws::Aws.init().unwrap();
|
platform::aws::Aws.init().unwrap();
|
||||||
std::thread::sleep(std::time::Duration::from_secs(500));
|
std::thread::sleep(std::time::Duration::from_secs(500));
|
||||||
|
|
Loading…
Reference in New Issue