summaryrefslogtreecommitdiff
path: root/vendor/github.com/varlink/go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/varlink/go')
-rw-r--r--vendor/github.com/varlink/go/varlink/service.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/github.com/varlink/go/varlink/service.go b/vendor/github.com/varlink/go/varlink/service.go
index c76c9b436..551ba4e53 100644
--- a/vendor/github.com/varlink/go/varlink/service.go
+++ b/vendor/github.com/varlink/go/varlink/service.go
@@ -51,6 +51,13 @@ type Service struct {
address string
}
+// ServiceTimoutError helps API users to special-case timeouts.
+type ServiceTimeoutError struct {}
+
+func (ServiceTimeoutError) Error() string {
+ return "service timeout"
+}
+
func (s *Service) getInfo(c Call) error {
return c.replyGetInfo(s.vendor, s.product, s.version, s.url, s.names)
}
@@ -297,7 +304,7 @@ func (s *Service) Listen(address string, timeout time.Duration) error {
s.mutex.Lock()
if s.conncounter == 0 {
s.mutex.Unlock()
- return nil
+ return ServiceTimeoutError{}
}
s.mutex.Unlock()
continue