mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-24 23:16:52 +00:00
Kraken: Fix TestGetOpenInterest (#1611)
* Kraken: Fix TestGetOpenInterest We see daily failures on OpenInterest for Kraken. This fix assumes that the issue might be related to volume of ETHUSD open interest, and switches the single pair test to XBTUSD instead Also isolates the test from others, since we're changing stored pairs and we might be colliding on the global k * Kraken: Handle Errors field in futures response
This commit is contained in:
@@ -1979,7 +1979,7 @@ func TestGetErrResp(t *testing.T) {
|
||||
case 3: // event != 'error'
|
||||
assert.NoError(t, testErr, "Message with non-'error' event field should not error")
|
||||
case 4: // event="error"
|
||||
assert.ErrorIs(t, testErr, errUnknownError, "error without a message should throw unknown error")
|
||||
assert.ErrorIs(t, testErr, common.ErrUnknownError, "error without a message should throw unknown error")
|
||||
assert.ErrorContains(t, testErr, "code: 0", "error without a code should throw code 0")
|
||||
case 5: // Fully formatted
|
||||
assert.ErrorContains(t, testErr, "redcoats", "message field should be in the error")
|
||||
|
||||
@@ -13,7 +13,6 @@ import (
|
||||
var (
|
||||
errSetCannotBeEmpty = errors.New("set cannot be empty")
|
||||
errNoSeqNo = errors.New("no sequence number")
|
||||
errUnknownError = errors.New("unknown error")
|
||||
errParamNotAllowed = errors.New("param not allowed")
|
||||
errParsingWSField = errors.New("error parsing WS field")
|
||||
errTickerInvalidSymbol = errors.New("invalid ticker symbol")
|
||||
|
||||
@@ -1866,7 +1866,7 @@ func (b *Bitfinex) unsubscribeFromChan(chans subscription.List) error {
|
||||
// getErrResp takes a json response string and looks for an error event type
|
||||
// If found it parses the error code and message as a wrapped error and returns it
|
||||
// It might log parsing errors about the nature of the error
|
||||
// If the error message is not defined it will return a wrapped errUnknownError
|
||||
// If the error message is not defined it will return a wrapped common.ErrUnknownError
|
||||
func (b *Bitfinex) getErrResp(resp []byte) error {
|
||||
event, err := jsonparser.GetUnsafeString(resp, "event")
|
||||
if err != nil {
|
||||
@@ -1883,7 +1883,7 @@ func (b *Bitfinex) getErrResp(resp []byte) error {
|
||||
var apiErr error
|
||||
if msg, e2 := jsonparser.GetString(resp, "msg"); e2 != nil {
|
||||
log.Errorf(log.ExchangeSys, "%s %s 'msg': %s from message: %s", b.Name, errParsingWSField, e2, resp)
|
||||
apiErr = errUnknownError
|
||||
apiErr = common.ErrUnknownError
|
||||
} else {
|
||||
apiErr = errors.New(msg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user