Floresta
Floresta copied to clipboard
Standardize Error handling across all the crates
closes
#86
This PR aims to standardize the error handling across all the crates mentioned in the comment https://github.com/Davidson-Souza/Floresta/issues/86#issuecomment-1822268886 (and more, if found).
- [ ] BlockchainError
- [ ] Error
- [ ] WireError
- [ ] PeerError
- [ ] BlockValidationErrors
- [ ] KvDatabaseError
- [ ] WatchOnlyError
- [ ] Socks5Error
As far as I have looked into this, there are various types of error handling in these crates.
The easiest ones being those which use anyhow
, simple custom type errors. Here syntactical modifications and error type from custom
to thiserror
will do the job.
But, for the custom error types, we have to convert their types to thiserror
type errors and then modify everything else(ie, function calls, error propagation, etc). The complications are even higher in cases where these custom error types are interconnected and one custom type gets converted to other custom forms (in the case of WireError
, PeerError
, BlockchainError
).
As for now, I haven't updated or appreciated any dependencies, for maintaining consistency over the codebase.