Skip to content

Commit e4ecaf8

Browse files
authored
rpc: implement Unwrap() for wsHandshakeError (#29522)
1 parent d3c4466 commit e4ecaf8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

rpc/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ func (c *Client) BatchCallContext(ctx context.Context, b []BatchElem) error {
431431
}
432432

433433
// Wait for all responses to come back.
434-
for n := 0; n < len(batchresp) && err == nil; n++ {
434+
for n := 0; n < len(batchresp); n++ {
435435
resp := batchresp[n]
436436
if resp == nil {
437437
// Ignore null responses. These can happen for batches sent via HTTP.

rpc/websocket.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ func (e wsHandshakeError) Error() string {
122122
return s
123123
}
124124

125+
func (e wsHandshakeError) Unwrap() error {
126+
return e.err
127+
}
128+
125129
func originIsAllowed(allowedOrigins mapset.Set[string], browserOrigin string) bool {
126130
it := allowedOrigins.Iterator()
127131
for origin := range it.C {

0 commit comments

Comments
 (0)