Skip to content

Commit

Permalink
rpc: implement Unwrap() for wsHandshakeError (#29522)
Browse files Browse the repository at this point in the history
  • Loading branch information
sucramx authored Apr 16, 2024
1 parent d3c4466 commit e4ecaf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func (c *Client) BatchCallContext(ctx context.Context, b []BatchElem) error {
}

// Wait for all responses to come back.
for n := 0; n < len(batchresp) && err == nil; n++ {
for n := 0; n < len(batchresp); n++ {
resp := batchresp[n]
if resp == nil {
// Ignore null responses. These can happen for batches sent via HTTP.
Expand Down
4 changes: 4 additions & 0 deletions rpc/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ func (e wsHandshakeError) Error() string {
return s
}

func (e wsHandshakeError) Unwrap() error {
return e.err
}

func originIsAllowed(allowedOrigins mapset.Set[string], browserOrigin string) bool {
it := allowedOrigins.Iterator()
for origin := range it.C {
Expand Down

0 comments on commit e4ecaf8

Please sign in to comment.