Support better chaining of errors with error_chain
Closed this issue · 2 comments
Support better chaining of errors, e.g. with the error-chain crate,
https://github.com/rust-lang-nursery/error-chain
Context:
Better passing of a header/entry mismatch error custom error that I've made into a validation error added here:
holochain-rust/crates/core/src/network/entry_with_header.rs
Lines 20 to 26 in e5410ce
I see that there is custom code for error handling in https://github.com/holochain/holochain-rust/blob/develop/crates/core_types/src/error/mod.rs, but unless I am mistaken, it seems like in practice errors may not be chained, e.g. as shown in the above example, where it seems like it would be better to have a custom error for the entry/header mismatch.
Perhaps #395 would address this, as noted here:
https://github.com/holochain/holochain-rust/blob/develop/crates/core_types/src/error/mod.rs#L40-L41