diff --git a/exchanges/bitfinex/bitfinex_types.go b/exchanges/bitfinex/bitfinex_types.go index e35521afe71..e55b90ff669 100644 --- a/exchanges/bitfinex/bitfinex_types.go +++ b/exchanges/bitfinex/bitfinex_types.go @@ -11,8 +11,10 @@ import ( ) var ( - errTypeAssert = errors.New("type assertion failed") - errSetCannotBeEmpty = errors.New("set cannot be empty") + errSetCannotBeEmpty = errors.New("set cannot be empty") + errSubNotFound = errors.New("could not find matching subscription") + errTooManyMatchingSubs = errors.New("too many matching subscriptions") + errTypeAssert = errors.New("type assertion failed") ) // AccountV2Data stores account v2 data diff --git a/exchanges/bitfinex/bitfinex_websocket.go b/exchanges/bitfinex/bitfinex_websocket.go index b941c5ceb25..7e938229e82 100644 --- a/exchanges/bitfinex/bitfinex_websocket.go +++ b/exchanges/bitfinex/bitfinex_websocket.go @@ -1559,13 +1559,13 @@ func (b *Bitfinex) chanForSub(cName string, assetType asset.Item, pair currency. for i := range subs { if subs[i].Equal(want) { if c != nil { - return nil, errors.New("too many matching subscriptions to find params") + return nil, errTooManyMatchingSubs } c = &subs[i] } } if c == nil { - return nil, errors.New("could not find matching subscription") + return nil, errSubNotFound } return c, nil