Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize Error handling across all the crates #155

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sudarshan-21
Copy link

@Sudarshan-21 Sudarshan-21 commented May 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant