Fix/Enhance Error-Handling
Opened this issue · 0 comments
Hoice's error-handling is based on error-chain
and has several issues as far as Hoice is concerned.
The main problem is that error-chain
erases errors, i.e. rsmt2
's errors become dyn std::error::Error
and it is not possible to know what the error is anymore.
(One very bad way is to check their description, but it's way too ugly to consider.)
This becomes bad because in some cases (pre-processing is the main example), it is convenient for hoice to encode the fact that a/some clause(s) are unsat/unknown as an Err
or. This leads to either contrived error-handling or bad behavior, such as #36.
I think hoice should have its own custom error-handling approach, which is actually not that hard to do. It could even be (mostly) compatible with error-chain
's API. This custom approach should allow to
- chain errors in a similar fashion to
error-chain
, - access the actual root (original) error without any type erasure.