Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown error, please check input. #295

Closed
ioogle opened this issue Aug 9, 2021 · 1 comment
Closed

Unknown error, please check input. #295

ioogle opened this issue Aug 9, 2021 · 1 comment

Comments

@ioogle
Copy link
Contributor

ioogle commented Aug 9, 2021

I want to get the liquidated orders from the past year:

// get liquidates from the past year
func (m *FuturesAPIService) fetchLiquidates(symbol string, limit int64) ([]*exmodel.FuturesLiquidate, error) {
	limit = 100
	service := m.futuresClient.NewListUserLiquidationOrdersService().Limit(int(limit))

	if symbol != "" {
		service = service.Symbol(convertSymbol(symbol, false))
	}

	startTime := time.Now().Add(-365 * 24 * time.Hour)
	nowTime := time.Now()
	var liquidates []*futures.UserLiquidationOrder
	
	for startTime.Before(nowTime) {
		lqs, err := service.StartTime(startTime.Unix() * 1000).EndTime(startTime.Add(7*24*time.Hour).Unix() * 1000).Do(m.ctx)
		if err != nil {
			if m.conf.Debug {
				logger.Println(err.Error())  // ①
			}
			if err.Error() == "Unknown error, please check input." {
				continue
			}
			return nil, convertError(err, excommon.GlobalMarketTypeFutures, symbol)
		}
		liquidates = append(liquidates, lqs...)

		startTime = startTime.Add(7 * 24 * time.Hour)
	}
	// ...

But sometimes when I execute the function above, ① will turn out an error, the error code is 0, and the error message is Unknown error, please check input., and not able to find this error in both of the API website and this package.

@xyq-c-cpp
Copy link
Collaborator

No response for a long time, close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants