28
28
* Exception thrown when an HTTP 4xx is received.
29
29
*
30
30
* @author Arjen Poutsma
31
+ * @author Sebastien Deleuze
31
32
* @since 3.0
32
33
* @see DefaultResponseErrorHandler
33
34
*/
@@ -85,7 +86,7 @@ public HttpClientErrorException(String message, HttpStatusCode statusCode, Strin
85
86
* @since 5.1
86
87
*/
87
88
public static HttpClientErrorException create (
88
- HttpStatusCode statusCode , String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
89
+ HttpStatusCode statusCode , String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
89
90
90
91
return create (null , statusCode , statusText , headers , body , charset );
91
92
}
@@ -97,7 +98,7 @@ public static HttpClientErrorException create(
97
98
*/
98
99
@ SuppressWarnings ("deprecation" )
99
100
public static HttpClientErrorException create (@ Nullable String message , HttpStatusCode statusCode ,
100
- String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
101
+ String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
101
102
102
103
if (statusCode instanceof HttpStatus status ) {
103
104
return switch (status ) {
@@ -160,12 +161,12 @@ public static HttpClientErrorException create(@Nullable String message, HttpStat
160
161
@ SuppressWarnings ("serial" )
161
162
public static final class BadRequest extends HttpClientErrorException {
162
163
163
- private BadRequest (String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
164
+ private BadRequest (String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
164
165
super (HttpStatus .BAD_REQUEST , statusText , headers , body , charset );
165
166
}
166
167
167
168
private BadRequest (String message , String statusText ,
168
- HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
169
+ HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
169
170
170
171
super (message , HttpStatus .BAD_REQUEST , statusText , headers , body , charset );
171
172
}
@@ -178,12 +179,12 @@ private BadRequest(String message, String statusText,
178
179
@ SuppressWarnings ("serial" )
179
180
public static final class Unauthorized extends HttpClientErrorException {
180
181
181
- private Unauthorized (String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
182
+ private Unauthorized (String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
182
183
super (HttpStatus .UNAUTHORIZED , statusText , headers , body , charset );
183
184
}
184
185
185
186
private Unauthorized (String message , String statusText ,
186
- HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
187
+ HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
187
188
188
189
super (message , HttpStatus .UNAUTHORIZED , statusText , headers , body , charset );
189
190
}
@@ -196,12 +197,12 @@ private Unauthorized(String message, String statusText,
196
197
@ SuppressWarnings ("serial" )
197
198
public static final class Forbidden extends HttpClientErrorException {
198
199
199
- private Forbidden (String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
200
+ private Forbidden (String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
200
201
super (HttpStatus .FORBIDDEN , statusText , headers , body , charset );
201
202
}
202
203
203
204
private Forbidden (String message , String statusText ,
204
- HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
205
+ HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
205
206
206
207
super (message , HttpStatus .FORBIDDEN , statusText , headers , body , charset );
207
208
}
@@ -214,12 +215,12 @@ private Forbidden(String message, String statusText,
214
215
@ SuppressWarnings ("serial" )
215
216
public static final class NotFound extends HttpClientErrorException {
216
217
217
- private NotFound (String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
218
+ private NotFound (String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
218
219
super (HttpStatus .NOT_FOUND , statusText , headers , body , charset );
219
220
}
220
221
221
222
private NotFound (String message , String statusText ,
222
- HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
223
+ HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
223
224
224
225
super (message , HttpStatus .NOT_FOUND , statusText , headers , body , charset );
225
226
}
@@ -232,12 +233,12 @@ private NotFound(String message, String statusText,
232
233
@ SuppressWarnings ("serial" )
233
234
public static final class MethodNotAllowed extends HttpClientErrorException {
234
235
235
- private MethodNotAllowed (String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
236
+ private MethodNotAllowed (String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
236
237
super (HttpStatus .METHOD_NOT_ALLOWED , statusText , headers , body , charset );
237
238
}
238
239
239
240
private MethodNotAllowed (String message , String statusText ,
240
- HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
241
+ HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
241
242
242
243
super (message , HttpStatus .METHOD_NOT_ALLOWED , statusText , headers , body , charset );
243
244
}
@@ -250,12 +251,12 @@ private MethodNotAllowed(String message, String statusText,
250
251
@ SuppressWarnings ("serial" )
251
252
public static final class NotAcceptable extends HttpClientErrorException {
252
253
253
- private NotAcceptable (String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
254
+ private NotAcceptable (String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
254
255
super (HttpStatus .NOT_ACCEPTABLE , statusText , headers , body , charset );
255
256
}
256
257
257
258
private NotAcceptable (String message , String statusText ,
258
- HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
259
+ HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
259
260
260
261
super (message , HttpStatus .NOT_ACCEPTABLE , statusText , headers , body , charset );
261
262
}
@@ -268,11 +269,11 @@ private NotAcceptable(String message, String statusText,
268
269
@ SuppressWarnings ("serial" )
269
270
public static final class Conflict extends HttpClientErrorException {
270
271
271
- private Conflict (String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
272
+ private Conflict (String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
272
273
super (HttpStatus .CONFLICT , statusText , headers , body , charset );
273
274
}
274
275
275
- private Conflict (String message , String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
276
+ private Conflict (String message , String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
276
277
super (message , HttpStatus .CONFLICT , statusText , headers , body , charset );
277
278
}
278
279
}
@@ -284,11 +285,11 @@ private Conflict(String message, String statusText, HttpHeaders headers, byte[]
284
285
@ SuppressWarnings ("serial" )
285
286
public static final class Gone extends HttpClientErrorException {
286
287
287
- private Gone (String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
288
+ private Gone (String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
288
289
super (HttpStatus .GONE , statusText , headers , body , charset );
289
290
}
290
291
291
- private Gone (String message , String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
292
+ private Gone (String message , String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
292
293
super (message , HttpStatus .GONE , statusText , headers , body , charset );
293
294
}
294
295
}
@@ -300,12 +301,12 @@ private Gone(String message, String statusText, HttpHeaders headers, byte[] body
300
301
@ SuppressWarnings ("serial" )
301
302
public static final class UnsupportedMediaType extends HttpClientErrorException {
302
303
303
- private UnsupportedMediaType (String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
304
+ private UnsupportedMediaType (String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
304
305
super (HttpStatus .UNSUPPORTED_MEDIA_TYPE , statusText , headers , body , charset );
305
306
}
306
307
307
308
private UnsupportedMediaType (String message , String statusText ,
308
- HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
309
+ HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
309
310
310
311
super (message , HttpStatus .UNSUPPORTED_MEDIA_TYPE , statusText , headers , body , charset );
311
312
}
@@ -318,12 +319,12 @@ private UnsupportedMediaType(String message, String statusText,
318
319
@ SuppressWarnings ("serial" )
319
320
public static final class UnprocessableContent extends HttpClientErrorException {
320
321
321
- private UnprocessableContent (String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
322
+ private UnprocessableContent (String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
322
323
super (HttpStatus .UNPROCESSABLE_CONTENT , statusText , headers , body , charset );
323
324
}
324
325
325
326
private UnprocessableContent (String message , String statusText ,
326
- HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
327
+ HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
327
328
328
329
super (message , HttpStatus .UNPROCESSABLE_CONTENT , statusText , headers , body , charset );
329
330
}
@@ -338,12 +339,12 @@ private UnprocessableContent(String message, String statusText,
338
339
@ SuppressWarnings ("serial" )
339
340
public static final class UnprocessableEntity extends HttpClientErrorException {
340
341
341
- private UnprocessableEntity (String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
342
+ private UnprocessableEntity (String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
342
343
super (HttpStatus .UNPROCESSABLE_ENTITY , statusText , headers , body , charset );
343
344
}
344
345
345
346
private UnprocessableEntity (String message , String statusText ,
346
- HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
347
+ HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
347
348
348
349
super (message , HttpStatus .UNPROCESSABLE_ENTITY , statusText , headers , body , charset );
349
350
}
@@ -356,12 +357,12 @@ private UnprocessableEntity(String message, String statusText,
356
357
@ SuppressWarnings ("serial" )
357
358
public static final class TooManyRequests extends HttpClientErrorException {
358
359
359
- private TooManyRequests (String statusText , HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
360
+ private TooManyRequests (String statusText , HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
360
361
super (HttpStatus .TOO_MANY_REQUESTS , statusText , headers , body , charset );
361
362
}
362
363
363
364
private TooManyRequests (String message , String statusText ,
364
- HttpHeaders headers , byte [] body , @ Nullable Charset charset ) {
365
+ HttpHeaders headers , byte @ Nullable [] body , @ Nullable Charset charset ) {
365
366
366
367
super (message , HttpStatus .TOO_MANY_REQUESTS , statusText , headers , body , charset );
367
368
}
0 commit comments