I want to switch from error_chain to thiserror crate.The implementation of thiserror looks way nicer and would allow to switch from generated error structs/tuples/enums etc to hand written errors. To start this process I need to find a very centered type which doesn't have to many dependencies etc.
The idea is that most modules will contain a custom error type. I don't want to pass up basic IO errors without context anymore. The error_chain cask supports this as well but I was never really in the clear if I use it correctly.
I started here with the unity::version::hash module as this is self contained and only presents two API's to the outside. Instead of std::io::Error it now returns a custom UnityHashError which wraps the internal errors that might happen in an enum.
Description
I want to switch from
error_chain
tothiserror
crate.The implementation ofthiserror
looks way nicer and would allow to switch from generated error structs/tuples/enums etc to hand written errors. To start this process I need to find a very centered type which doesn't have to many dependencies etc.The idea is that most modules will contain a custom error type. I don't want to pass up basic IO errors without context anymore. The
error_chain
cask supports this as well but I was never really in the clear if I use it correctly.I started here with the
unity::version::hash
module as this is self contained and only presents two API's to the outside. Instead ofstd::io::Error
it now returns a customUnityHashError
which wraps the internal errors that might happen in an enum.