diff options
author | jloup <jeanloup.jamet@gmail.com> | 2018-03-26 10:54:48 +0200 |
---|---|---|
committer | jloup <jeanloup.jamet@gmail.com> | 2018-03-26 10:55:40 +0200 |
commit | 908ee2dd22c85d5d850f62b1a9d0066b43b80a69 (patch) | |
tree | 8d8223b5bce680b49cd3b2a78d9b3b7d94803bc2 /api | |
parent | 6200f9a3c47770119abbb8b563ba32a0ea363949 (diff) | |
download | Front-908ee2dd22c85d5d850f62b1a9d0066b43b80a69.tar.gz Front-908ee2dd22c85d5d850f62b1a9d0066b43b80a69.tar.zst Front-908ee2dd22c85d5d850f62b1a9d0066b43b80a69.zip |
Handle poloniex ip restriction.
Diffstat (limited to 'api')
-rw-r--r-- | api/const.go | 3 | ||||
-rw-r--r-- | api/const_string.go | 4 |
2 files changed, 4 insertions, 3 deletions
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 ( | |||
19 | InvalidCredentials | 19 | InvalidCredentials |
20 | InvalidEmail | 20 | InvalidEmail |
21 | InvalidMarketCredentials | 21 | InvalidMarketCredentials |
22 | IPRestrictedApiKey | ||
22 | InvalidOtp | 23 | InvalidOtp |
23 | InvalidPassword | 24 | InvalidPassword |
24 | NeedOtpValidation | 25 | NeedOtpValidation |
@@ -35,7 +36,7 @@ func StatusToHttpCode(status Status, code ErrorCode) int { | |||
35 | } | 36 | } |
36 | 37 | ||
37 | switch code { | 38 | switch code { |
38 | case BadRequest, InvalidPassword, InvalidEmail, InvalidMarketCredentials: | 39 | case BadRequest, InvalidPassword, InvalidEmail, InvalidMarketCredentials, IPRestrictedApiKey: |
39 | return http.StatusBadRequest | 40 | return http.StatusBadRequest |
40 | 41 | ||
41 | case InvalidCredentials, InvalidOtp: | 42 | 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 { | |||
15 | return _Status_name[_Status_index[i]:_Status_index[i+1]] | 15 | return _Status_name[_Status_index[i]:_Status_index[i+1]] |
16 | } | 16 | } |
17 | 17 | ||
18 | const _ErrorCode_name = "BadRequestEmailExistsExternalServiceTimeoutInternalErrorInvalidCredentialsInvalidEmailInvalidMarketCredentialsInvalidOtpInvalidPasswordNeedOtpValidationNotAuthorizedNotFoundOtpAlreadySetupOtpNotSetupUserNotConfirmed" | 18 | const _ErrorCode_name = "BadRequestEmailExistsExternalServiceTimeoutInternalErrorInvalidCredentialsInvalidEmailInvalidMarketCredentialsIPRestrictedApiKeyInvalidOtpInvalidPasswordNeedOtpValidationNotAuthorizedNotFoundOtpAlreadySetupOtpNotSetupUserNotConfirmed" |
19 | 19 | ||
20 | var _ErrorCode_index = [...]uint8{0, 10, 21, 43, 56, 74, 86, 110, 120, 135, 152, 165, 173, 188, 199, 215} | 20 | var _ErrorCode_index = [...]uint8{0, 10, 21, 43, 56, 74, 86, 110, 128, 138, 153, 170, 183, 191, 206, 217, 233} |
21 | 21 | ||
22 | func (i ErrorCode) String() string { | 22 | func (i ErrorCode) String() string { |
23 | i -= 3 | 23 | i -= 3 |