@@ -32,8 +32,66 @@ public class RetryableException extends FeignException {
32
32
private final HttpMethod httpMethod ;
33
33
34
34
/**
35
- * @param retryAfter usually corresponds to the {@link feign.Util#RETRY_AFTER} header. If you
36
- * don't want to retry, set null.
35
+ * Represents a non-retryable exception when Retry-After information is explicitly not provided.
36
+ * <p>
37
+ * Use this constructor when the server response does not include a Retry-After header
38
+ * or when retries are not expected.
39
+ *
40
+ * @param status the HTTP status code
41
+ * @param message the exception message
42
+ * @param httpMethod the HTTP method (GET, POST, etc.)
43
+ * @param request the original HTTP request
44
+ */
45
+ public RetryableException (
46
+ int status ,
47
+ String message ,
48
+ HttpMethod httpMethod ,
49
+ Request request ) {
50
+ super (status , message , request );
51
+ this .httpMethod = httpMethod ;
52
+ this .retryAfter = null ;
53
+ }
54
+
55
+ /**
56
+ * Represents a non-retryable exception when Retry-After information is explicitly not provided.
57
+ * <p>
58
+ * Use this constructor when the server response does not include a Retry-After header
59
+ * or when retries are not expected.
60
+ *
61
+ * @param status the HTTP status code
62
+ * @param message the exception message
63
+ * @param httpMethod the HTTP method (GET, POST, etc.)
64
+ * @param cause the underlying cause of the exception
65
+ * @param request the original HTTP request
66
+ */
67
+ public RetryableException (
68
+ int status ,
69
+ String message ,
70
+ HttpMethod httpMethod ,
71
+ Throwable cause ,
72
+ Request request ) {
73
+ super (status , message , request , cause );
74
+ this .httpMethod = httpMethod ;
75
+ this .retryAfter = null ;
76
+ }
77
+
78
+ /**
79
+ * Represents a retryable exception when Retry-After information is available.
80
+ * <p>
81
+ * Use this constructor when the server response includes a Retry-After header
82
+ * specifying the delay in milliseconds before retrying.
83
+ * <p>
84
+ * If {@code retryAfter} is {@code null}, prefer using
85
+ * {@link #RetryableException(int, String, HttpMethod, Throwable, Request)} instead.
86
+ *
87
+ * @param status the HTTP status code
88
+ * @param message the exception message
89
+ * @param httpMethod the HTTP method (GET, POST, etc.)
90
+ * @param cause the underlying cause of the exception
91
+ * @param retryAfter the retry delay in milliseconds
92
+ * retryAfter usually corresponds to the {@link feign.Util#RETRY_AFTER} header. If you
93
+ * don't want to retry, use {@link #RetryableException(int, String, HttpMethod, Throwable, Request)}.
94
+ * @param request the original HTTP request
37
95
*/
38
96
public RetryableException (
39
97
int status ,
@@ -47,6 +105,17 @@ public RetryableException(
47
105
this .retryAfter = retryAfter ;
48
106
}
49
107
108
+ /**
109
+ * @deprecated Use {@link #RetryableException(int, String, HttpMethod, Throwable, Long, Request)}
110
+ * instead. This constructor uses {@link Date} for retryAfter, which has been replaced by {@link Long}.
111
+ *
112
+ * @param status the HTTP status code
113
+ * @param message the exception message
114
+ * @param httpMethod the HTTP method (GET, POST, etc.)
115
+ * @param cause the underlying cause of the exception
116
+ * @param retryAfter the retry-after time as a {@link Date}
117
+ * @param request the original HTTP request
118
+ */
50
119
@ Deprecated
51
120
public RetryableException (
52
121
int status ,
@@ -61,8 +130,17 @@ public RetryableException(
61
130
}
62
131
63
132
/**
64
- * @param retryAfter usually corresponds to the {@link feign.Util#RETRY_AFTER} header. If you
65
- * don't want to retry, set null.
133
+ * Represents a retryable exception when Retry-After information is available.
134
+ * <p>
135
+ * Use this constructor when the server response includes a Retry-After header.
136
+ *
137
+ * @param status the HTTP status code
138
+ * @param message the exception message
139
+ * @param httpMethod the HTTP method (GET, POST, etc.)
140
+ * @param retryAfter the retry delay in milliseconds
141
+ * retryAfter usually corresponds to the {@link feign.Util#RETRY_AFTER} header. If you
142
+ * don't want to retry, use {@link #RetryableException(int, String, HttpMethod, Request)}
143
+ * @param request the original HTTP request
66
144
*/
67
145
public RetryableException (
68
146
int status , String message , HttpMethod httpMethod , Long retryAfter , Request request ) {
@@ -71,6 +149,16 @@ public RetryableException(
71
149
this .retryAfter = retryAfter ;
72
150
}
73
151
152
+ /**
153
+ * @deprecated Use {@link #RetryableException(int, String, HttpMethod, Long, Request)}
154
+ * instead. This constructor uses {@link Date} for retryAfter, which has been replaced by {@link Long}.
155
+ *
156
+ * @param status the HTTP status code
157
+ * @param message the exception message
158
+ * @param httpMethod the HTTP method (GET, POST, etc.)
159
+ * @param retryAfter the retry-after time as a {@link Date}
160
+ * @param request the original HTTP request
161
+ */
74
162
@ Deprecated
75
163
public RetryableException (
76
164
int status , String message , HttpMethod httpMethod , Date retryAfter , Request request ) {
@@ -80,7 +168,18 @@ public RetryableException(
80
168
}
81
169
82
170
/**
83
- * @param retryAfter usually corresponds to the {@link feign.Util#RETRY_AFTER} header.
171
+ * Represents a retryable exception with response body and headers.
172
+ * <p>
173
+ * Use this constructor when handling HTTP responses that include Retry-After information.
174
+ *
175
+ * @param status the HTTP status code
176
+ * @param message the exception message
177
+ * @param httpMethod the HTTP method (GET, POST, etc.)
178
+ * @param retryAfter the retry delay in milliseconds
179
+ * retryAfter usually corresponds to the {@link feign.Util#RETRY_AFTER} header.
180
+ * @param request the original HTTP request
181
+ * @param responseBody the HTTP response body
182
+ * @param responseHeaders the HTTP response headers
84
183
*/
85
184
public RetryableException (
86
185
int status ,
@@ -95,6 +194,18 @@ public RetryableException(
95
194
this .retryAfter = retryAfter ;
96
195
}
97
196
197
+ /**
198
+ * @deprecated Use {@link #RetryableException(int, String, HttpMethod, Long, Request, byte[], Map)}
199
+ * instead. This constructor uses {@link Date} for retryAfter, which has been replaced by {@link Long}.
200
+ *
201
+ * @param status the HTTP status code
202
+ * @param message the exception message
203
+ * @param httpMethod the HTTP method (GET, POST, etc.)
204
+ * @param retryAfter the retry-after time as a {@link Date}
205
+ * @param request the original HTTP request
206
+ * @param responseBody the HTTP response body
207
+ * @param responseHeaders the HTTP response headers
208
+ */
98
209
@ Deprecated
99
210
public RetryableException (
100
211
int status ,
0 commit comments