Convert unwraps to ?
and improve logging
#2695
Labels
kind/cleanup
Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Right now, after a certain point in the init process, the logs do not get forwarded to systemd/journalctl as we change the root mount. After that point we don't send the error back via the main sender to the main process either, so we don't get any error logs. Thus, if the init process fails due to any reason, we only get
Error waiting for init ready, pipe broken
as the log, which makes it hard to debug.Also, there are several places where we have called
unwrap
on results, due to which the process panics, and as a result the errors are not propagated correctly. I think a better way here is to let the error propagate up by using?
, so that users of our library (in our case youki) can handle them as they want, which is a better practice for libraries.The text was updated successfully, but these errors were encountered: