diff --git a/rpc/errors.go b/rpc/errors.go index d74b9efc8304e..f32e7725c9da1 100644 --- a/rpc/errors.go +++ b/rpc/errors.go @@ -58,10 +58,12 @@ var ( ) const ( - errcodeDefault = -32000 - errcodeTimeout = -32002 - errcodePanic = -32603 - errcodeMarshalError = -32603 + errcodeDefault = -32000 + errcodeTimeout = -32002 + errcodePanic = -32603 + errcodeMarshalError = -32603 + + legacyErrcodeNotificationsUnsupported = -32001 ) const ( @@ -97,7 +99,11 @@ func (e notificationsUnsupportedError) Is(other error) bool { return true } rpcErr, ok := other.(Error) - return ok && rpcErr.ErrorCode() == -32601 + if ok { + code := rpcErr.ErrorCode() + return code == -32601 || code == legacyErrcodeNotificationsUnsupported + } + return false } type subscriptionNotFoundError struct{ namespace, subscription string }