Standardize Error handling across all the crates #155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes
#86This 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).
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 fromcustom
tothiserror
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 ofWireError
,PeerError
,BlockchainError
).As for now, I haven't updated or appreciated any dependencies, for maintaining consistency over the codebase.