Skip to content

Commit

Permalink
Merge pull request #18 from GeertJohan/patch-1
Browse files Browse the repository at this point in the history
ErrLookupdAddressExists
  • Loading branch information
mreiferson committed Nov 19, 2013
2 parents 104a2b5 + e577723 commit 47fead2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ var ErrAlreadyConnected = errors.New("already connected")
// returned from updateRdy if over max-in-flight
var ErrOverMaxInFlight = errors.New("over configure max-inflight")

// returned from ConnectToLookupd when given lookupd address exists already
var ErrLookupdAddressExists = errors.New("lookupd address already exists")

// Handler is the synchronous interface to Reader.
//
// Implement this interface for handlers that return whether or not message
Expand Down Expand Up @@ -471,7 +474,7 @@ func (q *Reader) ConnectToLookupd(addr string) error {
for _, x := range q.lookupdHTTPAddrs {
if x == addr {
q.Unlock()
return errors.New("lookupd address already exists")
return ErrLookupdAddressExists
}
}
q.lookupdHTTPAddrs = append(q.lookupdHTTPAddrs, addr)
Expand Down

0 comments on commit 47fead2

Please sign in to comment.