Hacker News new | ask | show | jobs
by onei 1711 days ago
I really like the thiserror crate for cutting down boilerplate and you can add annotations to automatically implement From. However, if you want to handle errors with more granularity, e.g. IO errors as noted elsewhere in the discussion, then you'll need to implement From yourself.

And as others noted, .map_err(...) is slightly better than .or(...) for wrapping errors.