exchanges: make ErrPairNotFound an exportable error

Stop erroring out when receiving execution reports from currency pairs
that have not been enabled.
This commit is contained in:
Luis Rascão
2022-01-17 00:18:59 +00:00
committed by GitHub
parent 58c0616a46
commit 058db10984

View File

@@ -47,6 +47,9 @@ var (
errEndpointStringNotFound = errors.New("endpoint string not found")
errTransportNotSet = errors.New("transport not set, cannot set timeout")
// ErrPairNotFound is an error message for when unable to find a currency pair
ErrPairNotFound = errors.New("pair not found")
)
func (b *Base) checkAndInitRequester() {
@@ -458,7 +461,8 @@ func (b *Base) GetRequestFormattedPairAndAssetType(p string) (currency.Pair, ass
}
}
}
return response, "", errors.New("pair not found: " + p)
return response, "",
fmt.Errorf("%s %w", p, ErrPairNotFound)
}
// GetAvailablePairs is a method that returns the available currency pairs