Skip to content

fix: implement Unwrap for wsHandshakeError and remove tautological loop condition (ethereum#29522) - #129

Merged
hmlee-wm merged 1 commit into
devfrom
fix/rpc-wsh-error-unwrap
Sep 15, 2026
Merged

hmlee-wm merged 1 commit into
devfrom
fix/rpc-wsh-error-unwrap

Conversation

@hmlee-wm

@hmlee-wm hmlee-wm commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ports ethereum#29522. Adds Unwrap() to wsHandshakeError so the underlying error is reachable via errors.Is()/errors.As(). Also removes a tautological err == nil condition from the BatchCallContext loop, where err is never modified inside the loop body.

Upstream References

PR Description
#29522 rpc: implement Unwrap() for wsHandshakeError

Changes

  • rpc/websocket.go: add func (e wsHandshakeError) Unwrap() error { return e.err } to expose the wrapped error through the standard error chain
  • rpc/client.go: remove && err == nil from BatchCallContext loop condition — err is never assigned inside the loop, making the condition always true

(cherry picked from commit e4ecaf89cf5ee6233094f738c4978020fe63e237)
@hmlee-wm hmlee-wm self-assigned this Sep 4, 2026
@hmlee-wm hmlee-wm added the bug Something isn't working label Sep 4, 2026

@colinkim colinkim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@eomti-wm eomti-wm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@hmlee-wm
hmlee-wm merged commit 99f6ad3 into dev Sep 15, 2026
3 checks passed
@hmlee-wm
hmlee-wm deleted the fix/rpc-wsh-error-unwrap branch September 15, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants