-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
fix(abci): add unwrapper to handle join error #23712
base: release/v0.50.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
I am not sure about the error selection though.
baseapp/baseapp_test.go
Outdated
@@ -4,6 +4,7 @@ import ( | |||
"bytes" | |||
"context" | |||
"crypto/sha256" | |||
"errors" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same errors package as in baseapp should be used
errors/abci.go
Outdated
@@ -59,6 +59,16 @@ func abciCode(err error) uint32 { | |||
} | |||
|
|||
for { | |||
if c, ok := err.(interface{ Unwrap() []error }); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to have this interface extracted with some meaningful name
errs := c.Unwrap() | ||
for _, e := range errs { | ||
if e != nil { | ||
err = e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if "first error" wins is correct. You could also have first coder
error win. or last... it would be good to understand the scenario better. I have commented on the issue.
Skipping any nil errors does make sense though. This could be achieved by using Go stdlib errors.Join in baseapp as well.
Description
Closes: #23709
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...