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

core: use errors.Is for consensus errors check #21095

Merged
merged 1 commit into from
Aug 5, 2020

Conversation

robert-zaremba
Copy link
Contributor

Often it's useful to wrap errors to provide more contextual information about errors. Go errors standard library have few convenient functions to inspect wrapped errors: errors.Is and errors.As.

consensus package defines few constant errors (eg consensus.ErrUnknownAncestor), which don't carry much information.
In a fork I'm developing, I'm wrapping errors from consensus package, but this breaks some of the core functionality, as it is using static checks, which is not very scaleable (functional wise). For start I would like to port some of this changes here and maybe in the future we can wrap errors.

@karalabe
Copy link
Member

We'll merge this after the builders are updated to drop Go 1.12. Martin has a PR.

@holiman
Copy link
Contributor

holiman commented Aug 3, 2020

I rebased this on master. Let's merge on green

@fjl fjl merged commit 5a88a7c into ethereum:master Aug 5, 2020
@fjl fjl removed the pr:merge label Aug 5, 2020
@fjl fjl added this to the 1.9.19 milestone Aug 5, 2020
@robert-zaremba
Copy link
Contributor Author

Thanks for merging.
BTW - how can I change my email address in Authors? I did a PR and it was rejected. in AUTHORS there is my deprecated email

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.

5 participants