fixup error handling
This commit is contained in:
parent
68326174f7
commit
b3a16d49bc
|
@ -9,7 +9,7 @@ use system::dmesg;
|
|||
fn main() {
|
||||
if let Err(e) = init() {
|
||||
dmesg(format!("Error: {e}"));
|
||||
let mut opt = Some(&e as &dyn std::error::Error);
|
||||
let mut opt = std::error::Error::source(&e);
|
||||
while let Some(current_source) = opt {
|
||||
dmesg(format!("Caused by: {current_source}"));
|
||||
opt = current_source.source();
|
||||
|
@ -28,7 +28,7 @@ fn init() -> Result<()> {
|
|||
if let Err(errors) = system::mount_default_targets() {
|
||||
for error in errors {
|
||||
dmesg(format!("Error while mounting: {error}"));
|
||||
let mut opt = Some(&error as &dyn std::error::Error);
|
||||
let mut opt = std::error::Error::source(&error);
|
||||
while let Some(current_source) = opt {
|
||||
dmesg(format!("Caused by: {current_source}"));
|
||||
opt = current_source.source();
|
||||
|
@ -65,7 +65,7 @@ fn init() -> Result<()> {
|
|||
*/
|
||||
}
|
||||
config::Mode::Exec => {
|
||||
dmesg("pivoting to {command}");
|
||||
dmesg(format!("pivoting to {command}"));
|
||||
system::syscall::execv(command, &[])?;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue