From 908ee2dd22c85d5d850f62b1a9d0066b43b80a69 Mon Sep 17 00:00:00 2001 From: jloup Date: Mon, 26 Mar 2018 10:54:48 +0200 Subject: Handle poloniex ip restriction. --- api/const.go | 3 ++- api/const_string.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'api') diff --git a/api/const.go b/api/const.go index 1b22355..d3e5f42 100644 --- a/api/const.go +++ b/api/const.go @@ -19,6 +19,7 @@ const ( InvalidCredentials InvalidEmail InvalidMarketCredentials + IPRestrictedApiKey InvalidOtp InvalidPassword NeedOtpValidation @@ -35,7 +36,7 @@ func StatusToHttpCode(status Status, code ErrorCode) int { } switch code { - case BadRequest, InvalidPassword, InvalidEmail, InvalidMarketCredentials: + case BadRequest, InvalidPassword, InvalidEmail, InvalidMarketCredentials, IPRestrictedApiKey: return http.StatusBadRequest case InvalidCredentials, InvalidOtp: diff --git a/api/const_string.go b/api/const_string.go index e4b9e50..58ed230 100644 --- a/api/const_string.go +++ b/api/const_string.go @@ -15,9 +15,9 @@ func (i Status) String() string { return _Status_name[_Status_index[i]:_Status_index[i+1]] } -const _ErrorCode_name = "BadRequestEmailExistsExternalServiceTimeoutInternalErrorInvalidCredentialsInvalidEmailInvalidMarketCredentialsInvalidOtpInvalidPasswordNeedOtpValidationNotAuthorizedNotFoundOtpAlreadySetupOtpNotSetupUserNotConfirmed" +const _ErrorCode_name = "BadRequestEmailExistsExternalServiceTimeoutInternalErrorInvalidCredentialsInvalidEmailInvalidMarketCredentialsIPRestrictedApiKeyInvalidOtpInvalidPasswordNeedOtpValidationNotAuthorizedNotFoundOtpAlreadySetupOtpNotSetupUserNotConfirmed" -var _ErrorCode_index = [...]uint8{0, 10, 21, 43, 56, 74, 86, 110, 120, 135, 152, 165, 173, 188, 199, 215} +var _ErrorCode_index = [...]uint8{0, 10, 21, 43, 56, 74, 86, 110, 128, 138, 153, 170, 183, 191, 206, 217, 233} func (i ErrorCode) String() string { i -= 3 -- cgit v1.2.3