diff --git a/transport/grpc/resolver/discovery/builder.go b/transport/grpc/resolver/discovery/builder.go index 3d147cd83b2..5a084416a0c 100644 --- a/transport/grpc/resolver/discovery/builder.go +++ b/transport/grpc/resolver/discovery/builder.go @@ -14,6 +14,8 @@ import ( const name = "discovery" +var ErrWatcherCreateTimeout = errors.New("discovery create watcher overtime") + // Option is builder option. type Option func(o *builder) @@ -96,7 +98,7 @@ func (b *builder) Build(target resolver.Target, cc resolver.ClientConn, _ resolv case <-done: err = watchRes.err case <-time.After(b.timeout): - err = errors.New("discovery create watcher overtime") + err = ErrWatcherCreateTimeout } if err != nil { cancel()