diff --git a/consumer.go b/consumer.go index 0e40dabb..0173a8ec 100644 --- a/consumer.go +++ b/consumer.go @@ -533,7 +533,7 @@ func (r *Consumer) DisconnectFromNSQD(addr string) error { idx := indexOf(addr, r.nsqdTCPAddrs) if idx == -1 { - return errors.New(fmt.Sprintf("unknown nsqd TCP address %s", addr)) + return ErrNotConnected } // slice delete @@ -557,7 +557,7 @@ func (r *Consumer) DisconnectFromNSQLookupd(addr string) error { idx := indexOf(addr, r.lookupdHTTPAddrs) if idx == -1 { - return errors.New(fmt.Sprintf("unknown nsqlookupd HTTP address %s", addr)) + return ErrNotConnected } if len(r.lookupdHTTPAddrs) == 1 {