Add local error handling in WebClient.retrieve
This commit introduces a way to customize the WebClientExceptions, as thrown by WebClient.ResponseSpec.bodyTo[Mono|Flux]. The first customization will override the defaults, additional customizations are simply tried in order. Issue: SPR-15724
This commit is contained in:
@@ -465,6 +465,16 @@ public enum HttpStatus {
|
||||
return Series.SERVER_ERROR.equals(series());
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this status code is in the HTTP series
|
||||
* {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR} or
|
||||
* {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR}.
|
||||
* This is a shortcut for checking the value of {@link #series()}.
|
||||
*/
|
||||
public boolean isError() {
|
||||
return is4xxClientError() || is5xxServerError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the HTTP status series of this status code.
|
||||
* @see HttpStatus.Series
|
||||
|
||||
Reference in New Issue
Block a user