Skip to content

Commit ae1d0f7

Browse files
Merge pull request #2148 from Netflix/too-many-requests
split 429 Too Many Requests into its own error type
2 parents aa9eb6c + 2ef18f7 commit ae1d0f7

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

graphql-error-types/src/main/java/com/netflix/graphql/types/errors/ErrorDetail.java

+11-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import static com.netflix.graphql.types.errors.ErrorType.*;
2323

2424
/**
25-
* The ErrorDetail is an optional field which will provide more fine grained information on the error condition.
25+
* The ErrorDetail is an optional field which will provide more fine-grained information on the error condition.
2626
* This allows the ErrorType enumeration to be small and mostly static so that application branching logic
2727
* can depend on it. The ErrorDetail provides a more specific cause for the error. This enumeration will
2828
* be much larger and likely change/grow over time.
@@ -59,11 +59,20 @@ enum Common implements ErrorDetail {
5959
* The server detected that the client is exhibiting a behavior that
6060
* might be generating excessive load.
6161
* <p>
62-
* HTTP Mapping: 429 Too Many Requests or 420 Enhance Your Calm
62+
* HTTP Mapping: 420 Enhance Your Calm
6363
* Error Type: UNAVAILABLE
6464
*/
6565
ENHANCE_YOUR_CALM(UNAVAILABLE),
6666

67+
/**
68+
* The server detected that the client is exhibiting a behavior that
69+
* might be generating excessive load.
70+
* <p>
71+
* HTTP Mapping: 429 Too Many Requests
72+
* Error Type: UNAVAILABLE
73+
*/
74+
TOO_MANY_REQUESTS(UNAVAILABLE),
75+
6776
/**
6877
* The requested field is not found in the schema.
6978
* <p>

graphql-error-types/src/main/resources/META-INF/schema/errordetail.graphqls

+10-1
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,20 @@ enum ErrorDetail {
107107
The server detected that the client is exhibiting a behavior that
108108
might be generating excessive load.
109109
110-
HTTP Mapping: 429 Too Many Requests or 420 Enhance Your Calm
110+
HTTP Mapping: 420 Enhance Your Calm
111111
Error Type: UNAVAILABLE
112112
"""
113113
ENHANCE_YOUR_CALM
114114

115+
"""
116+
The server detected that the client is exhibiting a behavior that
117+
might be generating excessive load.
118+
119+
HTTP Mapping: 429 Too Many Requests
120+
Error Type: UNAVAILABLE
121+
"""
122+
TOO_MANY_REQUESTS
123+
115124
"""
116125
Request failed due to network errors.
117126

0 commit comments

Comments
 (0)