Convert unwraps to `?` and improve logging
YJDoc2 opened this issue · comments
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.
Good idea. Let's move on to the next step. How about establishing the procedure that produces this error message for starters?