When I started with Rust I found the error handling very painful. Then I discovered the
? operator and that seemed to make things work: until I hit the wall that it didn’t work at all if I called two functions that returned different types of error.
Fortunately, I then found the error-chain crate. This allows me to have return types of
Result<SomeType> and to use the
? operator on different functions that return different error types (providing I specify these types using
foreign_links; something I’ve found quite tricky to get right). Also I haven’t always found error-chain easy to use and have had to ask on this forum for help with it more than once.
However, there are other error handling crates, e.g., failure and quick-error. Is one of these (or some other) error handling crate the recommended one (or likely to be)?