Skip to content

Commit

Permalink
feat(resolver/discovery): expose create watcher timeout error (#3392)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThereWeGo committed Aug 19, 2024
1 parent 084c8b4 commit 6427904
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion transport/grpc/resolver/discovery/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 6427904

Please sign in to comment.