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

Updated Error Handling. #21

Merged
merged 2 commits into from
Feb 14, 2024
Merged

Conversation

rajarshimaitra
Copy link
Contributor

Fixes #8

This is a big refactoring PR so would take some review effort.

Salient points:

  • New error structure that directly wraps the inner error type. This allows internal error progression without any mapping.
  • error.rs move to src/. This allows error enum to be documented at crate level (good practise).
  • Removes all dangling unwraps. After this PR there should not be any dangling unwraps across crate, in future too. Errors should always be propagated directly.

Simplifying error handling also implies code verbosity. This PR removes more lines than it adds.

Remove the S5Error and ErrorKind enum. These explicit error types are not
required and errors should wrap the internal error fully to not loose details.

error module moved to crate level. This puts the error docs in the crate
level documentation.
use the new error structure accross module. After this commit there should not
be any dangling unwrap left.
@i5hi i5hi merged commit cb53d63 into SatoshiPortal:trunk Feb 14, 2024
3 checks passed
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.

Better Errors
2 participants