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

pull/29553/head
Marcus Baldassarre 7 months ago committed by GitHub
parent d3c4466edd
commit e4ecaf89cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      rpc/client.go
  2. 4
      rpc/websocket.go

@ -431,7 +431,7 @@ func (c *Client) BatchCallContext(ctx context.Context, b []BatchElem) error {
} }
// Wait for all responses to come back. // 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] resp := batchresp[n]
if resp == nil { if resp == nil {
// Ignore null responses. These can happen for batches sent via HTTP. // Ignore null responses. These can happen for batches sent via HTTP.

@ -122,6 +122,10 @@ func (e wsHandshakeError) Error() string {
return s return s
} }
func (e wsHandshakeError) Unwrap() error {
return e.err
}
func originIsAllowed(allowedOrigins mapset.Set[string], browserOrigin string) bool { func originIsAllowed(allowedOrigins mapset.Set[string], browserOrigin string) bool {
it := allowedOrigins.Iterator() it := allowedOrigins.Iterator()
for origin := range it.C { for origin := range it.C {

Loading…
Cancel
Save