Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
So far the crate has used std::io::Error as its error type. It is sufficient for the most part, but it's not optimal long-term: - by not abstracting it we are not very flexible once we need additional "kinds" or variants in the future - that also applies to features such as capturing of backtraces at time of error - because it is defined outside of our crate, certain usability limitations may be imposed on us - io::Error does not lend itself to proper error chaining and that will make it harder to contextualize errors as the code base grows To fix these issues, this change introduces a new public error type. The type is still very close to io::Error, just by virtue of us doing a lot of IO and so it is a natural fit. We certainly mirror several of the std::io::ErrorKind variants in our own version of ErrorKind. On top of of the error itself we also add a bunch of convenience conversion functions, mostly to provide additional context. These are heavily inspired by anyhow's Error type. That crate also acted as role model for the way we format our errors. Signed-off-by: Daniel Müller <deso@posteo.net>
- Loading branch information