Instead of calling Result::unwrap or Result::expect, which panic if the result is not Ok, we return the error to the caller. That will hopefully be logged and thus visible to the user in a way that is easier to deal with than a panic
This leaves only a few JoinHandle::join results that are handled in a way that causes a panic. JoinHandle returns errors that do not implement the std::error::Error trait, which makes them a little harder to handle the way other errors are handled. Specifically, thiserror doesn’t like them as source errors. I’m ignoring the join errors for now.
Every other error is handled. The only unwrap or expect method calls now are for the join errors or for Options.
Signed-off-by: Lars Wirzenius liw@liw.fi
Instead of calling Result::unwrap or Result::expect, which panic if the result is not Ok, we return the error to the caller. That will hopefully be logged and thus visible to the user in a way that is easier to deal with than a panic
This leaves only a few JoinHandle::join results that are handled in a way that causes a panic. JoinHandle returns errors that do not implement the std::error::Error trait, which makes them a little harder to handle the way other errors are handled. Specifically, thiserror doesn’t like them as source errors. I’m ignoring the join errors for now.
Every other error is handled. The only unwrap or expect method calls now are for the join errors or for Options.
Signed-off-by: Lars Wirzenius liw@liw.fi