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

Refactor errors #158

Merged
merged 7 commits into from
Feb 19, 2020
Merged

Refactor errors #158

merged 7 commits into from
Feb 19, 2020

Conversation

liamsi
Copy link
Member

@liamsi liamsi commented Feb 13, 2020

Consistent error handling across the repo.
I have written up some notes briefly explaining what "consistent" means here. Will post them Posted in #150 (comment). They can be used for an ADR if that's desired.

closes #150

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGES.md

 - use thiserror and anomaly
 - rename ValidationError -> validate::Error
 - rename ValidationErrorKind -> Kind
 - we do not use anomalys serializer feature

cleanup Cargo.toml: remove failure and unused feature:
 - we do not use anomalys serializer feature
 - remove last place which used failure
 (looks like we accidentally imported `failure::_core::fmt::Debug`
  instead of just `std::fmt::Debug`
@liamsi
Copy link
Member Author

liamsi commented Feb 13, 2020

codecov wasn't reporting because of a missing report for the base commit. Deleted its comment.

Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tis extra dope!

Generally I'd err on the side of more qualification so use crate::error and then error::Error and error::Kind. Also left some remarks inline. ✌️

tendermint/src/amino_types/block_id.rs Outdated Show resolved Hide resolved
tendermint/src/amino_types/proposal.rs Outdated Show resolved Hide resolved
tendermint/src/amino_types/proposal.rs Outdated Show resolved Hide resolved
tendermint/src/amino_types/proposal.rs Outdated Show resolved Hide resolved
tendermint/src/amino_types/signature.rs Outdated Show resolved Hide resolved
@liamsi liamsi requested a review from xla February 18, 2020 13:23
@informalsystems informalsystems deleted a comment from codecov-io Feb 18, 2020
@informalsystems informalsystems deleted a comment from codecov-io Feb 18, 2020
@codecov-io
Copy link

Codecov Report

Merging #158 into master will increase coverage by 0.07%.
The diff coverage is 45.45%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #158      +/-   ##
=========================================
+ Coverage   37.42%   37.5%   +0.07%     
=========================================
  Files          91      91              
  Lines        3140    3144       +4     
  Branches      484     485       +1     
=========================================
+ Hits         1175    1179       +4     
- Misses       1690    1691       +1     
+ Partials      275     274       -1
Impacted Files Coverage Δ
tendermint/src/lite/error.rs 47.05% <0%> (+0.9%) ⬆️
tendermint/src/lite/types.rs 49.13% <0%> (+0.56%) ⬆️
tendermint-lite/src/main.rs 0% <0%> (ø) ⬆️
tendermint/src/lite_impl/signed_header.rs 78.84% <44.44%> (ø) ⬆️
tendermint/src/lite/verifier.rs 74.7% <61.11%> (-0.5%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f025f2...b43ab63. Read the comment docs.

Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I'd err on the side of more qualification so use crate::error and then error::Error and error::Kind.

@liamsi Think this could be addressed in this PR.

Otherwise: 🤘 🎥 🎊 🗞

@liamsi
Copy link
Member Author

liamsi commented Feb 19, 2020

Merging as is now. Will address below in a separate PR which will add an ADR, too.

Generally I'd err on the side of more qualification so use crate::error and then error::Error and error::Kind.

@liamsi liamsi merged commit 8df037d into master Feb 19, 2020
@liamsi liamsi deleted the ismail/error_overhaul branch February 19, 2020 15:54
@liamsi liamsi mentioned this pull request Feb 19, 2020
@ebuchman ebuchman mentioned this pull request Nov 21, 2020
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.

Failure crate: "soft ecosystem deprecated"
3 participants