Merge pull request #13449 from influxdata/error-429

chore(http): add 429 response to errors
pull/13437/head
Jade McGough 2019-04-17 22:12:34 -07:00 committed by GitHub
commit 1b50785fb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,7 @@ const (
EEmptyValue = "empty value" EEmptyValue = "empty value"
EUnavailable = "unavailable" EUnavailable = "unavailable"
EForbidden = "forbidden" EForbidden = "forbidden"
ETooManyRequests = "too many requests"
EUnauthorized = "unauthorized" EUnauthorized = "unauthorized"
EMethodNotAllowed = "method not allowed" EMethodNotAllowed = "method not allowed"
) )

View File

@ -117,6 +117,7 @@ var statusCodePlatformError = map[string]int{
platform.ENotFound: http.StatusNotFound, platform.ENotFound: http.StatusNotFound,
platform.EUnavailable: http.StatusServiceUnavailable, platform.EUnavailable: http.StatusServiceUnavailable,
platform.EForbidden: http.StatusForbidden, platform.EForbidden: http.StatusForbidden,
platform.ETooManyRequests: http.StatusTooManyRequests,
platform.EUnauthorized: http.StatusUnauthorized, platform.EUnauthorized: http.StatusUnauthorized,
platform.EMethodNotAllowed: http.StatusMethodNotAllowed, platform.EMethodNotAllowed: http.StatusMethodNotAllowed,
} }

View File

@ -6157,6 +6157,7 @@ components:
- empty value - empty value
- unavailable - unavailable
- forbidden - forbidden
- too many requests
- unauthorized - unauthorized
- method not allowed - method not allowed
message: message: