クラス WebClientResponseException
java.lang.ObjectSE
java.lang.ThrowableSE
java.lang.ExceptionSE
java.lang.RuntimeExceptionSE
org.springframework.core.NestedRuntimeException
org.springframework.web.reactive.function.client.WebClientException
org.springframework.web.reactive.function.client.WebClientResponseException
- 実装されているすべてのインターフェース:
SerializableSE
- 既知の直属サブクラス
UnknownHttpStatusCodeException、WebClientResponseException.BadGateway、WebClientResponseException.BadRequest、WebClientResponseException.Conflict、WebClientResponseException.Forbidden、WebClientResponseException.GatewayTimeout、WebClientResponseException.Gone、WebClientResponseException.InternalServerError、WebClientResponseException.MethodNotAllowed、WebClientResponseException.NotAcceptable、WebClientResponseException.NotFound、WebClientResponseException.NotImplemented、WebClientResponseException.ServiceUnavailable、WebClientResponseException.TooManyRequests、WebClientResponseException.Unauthorized、WebClientResponseException.UnprocessableEntity、WebClientResponseException.UnsupportedMediaType
実際の HTTP レスポンスデータを含む例外。
- 導入:
- 5.0
- 作成者:
- Arjen Poutsma, Sebastien Deleuze
- 関連事項:
ネストされたクラスの要約
ネストされたクラス修飾子と型クラス説明static classHTTP ステータス 502BadGateway のWebClientResponseException。static classWebClientResponseExceptionステータス HTTP 400 Bad Requeststatic classWebClientResponseExceptionステータス HTTP 409 Conflictstatic classWebClientResponseExceptionステータス HTTP 403 Forbiddenstatic classWebClientResponseExceptionステータス HTTP 504 Gateway Timeoutstatic classWebClientResponseExceptionステータス HTTP 410 Gonestatic classWebClientResponseExceptionステータス HTTP 500 Internal Server Errorstatic classWebClientResponseExceptionステータス HTTP 405 Method Not Allowedstatic classWebClientResponseExceptionステータス HTTP 406 Not Acceptablestatic classWebClientResponseExceptionステータス HTTP 404 Not Foundstatic classWebClientResponseExceptionステータス HTTP 501 Not Implementedstatic classWebClientResponseExceptionステータス HTTP 503 Service Unavailablestatic classWebClientResponseExceptionステータス HTTP 429 Too Many Requestsstatic classWebClientResponseExceptionステータス HTTP 401 Unauthorizedstatic classWebClientResponseExceptionステータス HTTP 422 Unprocessable Entitystatic classWebClientResponseExceptionステータス HTTP 415 Unsupported Media Typeコンストラクターの概要
コンストラクターコンストラクター説明WebClientResponseException(int statusCode, StringSE statusText, HttpHeaders headers, byte[] body, CharsetSE charset) レスポンスデータのみを含むコンストラクター、およびデフォルトメッセージ。WebClientResponseException(int status, StringSE reasonPhrase, HttpHeaders headers, byte[] body, CharsetSE charset, HttpRequest request) レスポンスデータのみを含むコンストラクター、およびデフォルトメッセージ。WebClientResponseException(StringSE message, int statusCode, StringSE statusText, HttpHeaders headers, byte[] responseBody, CharsetSE charset) 準備されたメッセージを持つコンストラクター。WebClientResponseException(StringSE message, int statusCode, StringSE statusText, HttpHeaders headers, byte[] responseBody, CharsetSE charset, HttpRequest request) 準備されたメッセージを持つコンストラクター。WebClientResponseException(StringSE message, HttpStatusCode statusCode, StringSE statusText, HttpHeaders headers, byte[] responseBody, CharsetSE charset, HttpRequest request) 準備されたメッセージを持つコンストラクター。WebClientResponseException(HttpStatusCode statusCode, StringSE reasonPhrase, HttpHeaders headers, byte[] body, CharsetSE charset, HttpRequest request) レスポンスデータのみを含むコンストラクター、およびデフォルトメッセージ。メソッドのサマリー
修飾子と型メソッド説明static WebClientResponseExceptioncreate(int statusCode, StringSE statusText, HttpHeaders headers, byte[] body, CharsetSE charset) WebClientResponseExceptionまたは HTTP ステータス固有のサブクラスを作成します。static WebClientResponseExceptioncreate(int statusCode, StringSE statusText, HttpHeaders headers, byte[] body, CharsetSE charset, HttpRequest request) WebClientResponseExceptionまたは HTTP ステータス固有のサブクラスを作成します。static WebClientResponseExceptioncreate(HttpStatusCode statusCode, StringSE statusText, HttpHeaders headers, byte[] body, CharsetSE charset, HttpRequest request) WebClientResponseExceptionまたは HTTP ステータス固有のサブクラスを作成します。HTTP レスポンスヘッダーを返します。int使用すべきではありません。対応するリクエストを返します。<E> EgetResponseBodyAs(ClassSE<E> targetType) エラー内容を指定された型にデコードします。<E> EgetResponseBodyAs(ParameterizedTypeReference<E> targetType) byte[]レスポンス本文をバイト配列として返します。レスポンスのコンテンツを文字列として返します。使用可能な場合はレスポンスのメディア型の文字セットを使用するか、そうでない場合は UTF-8 にフォールバックします。getResponseBodyAsString(CharsetSE defaultCharset) レスポンスのメディア型から文字セットが利用できない場合に、フォールバックする文字セットを指定できるようにするgetResponseBodyAsString()のバリアント。HTTP ステータスコード値を返します。HTTP ステータステキストを返します。voidsetBodyDecodeFunction(FunctionSE<ResolvableType, ?> decoderFunction) 指定されたターゲット型のデコーダーを見つける関数を提供します。クラス org.springframework.core.NestedRuntimeException から継承されたメソッド
contains, getMostSpecificCause, getRootCauseクラス java.lang.ThrowableSE から継承されたメソッド
addSuppressedSE, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCauseSE, printStackTrace, printStackTraceSE, printStackTraceSE, setStackTraceSE, toString
コンストラクターの詳細
WebClientResponseException
public WebClientResponseException(int statusCode, StringSE statusText, @Nullable HttpHeaders headers, @Nullable byte[] body, @Nullable CharsetSE charset) レスポンスデータのみを含むコンストラクター、およびデフォルトメッセージ。- 導入:
- 5.1
WebClientResponseException
public WebClientResponseException(int status, StringSE reasonPhrase, @Nullable HttpHeaders headers, @Nullable byte[] body, @Nullable CharsetSE charset, @Nullable HttpRequest request) レスポンスデータのみを含むコンストラクター、およびデフォルトメッセージ。- 導入:
- 5.1.4
WebClientResponseException
public WebClientResponseException(HttpStatusCode statusCode, StringSE reasonPhrase, @Nullable HttpHeaders headers, @Nullable byte[] body, @Nullable CharsetSE charset, @Nullable HttpRequest request) レスポンスデータのみを含むコンストラクター、およびデフォルトメッセージ。- 導入:
- 6.0
WebClientResponseException
public WebClientResponseException(StringSE message, int statusCode, StringSE statusText, @Nullable HttpHeaders headers, @Nullable byte[] responseBody, @Nullable CharsetSE charset) 準備されたメッセージを持つコンストラクター。WebClientResponseException
public WebClientResponseException(StringSE message, int statusCode, StringSE statusText, @Nullable HttpHeaders headers, @Nullable byte[] responseBody, @Nullable CharsetSE charset, @Nullable HttpRequest request) 準備されたメッセージを持つコンストラクター。- 導入:
- 5.1.4
WebClientResponseException
public WebClientResponseException(StringSE message, HttpStatusCode statusCode, StringSE statusText, @Nullable HttpHeaders headers, @Nullable byte[] responseBody, @Nullable CharsetSE charset, @Nullable HttpRequest request) 準備されたメッセージを持つコンストラクター。- 導入:
- 6.0
メソッドの詳細
getStatusCode
HTTP ステータスコード値を返します。- 例外:
IllegalArgumentExceptionSE- 不明な HTTP ステータスコードの場合
getRawStatusCode
使用すべきではありません。getStatusCode()を推奨し、7.0 から削除生の HTTP ステータスコード値を返します。getStatusText
HTTP ステータステキストを返します。getHeaders
HTTP レスポンスヘッダーを返します。getResponseBodyAsByteArray
public byte[] getResponseBodyAsByteArray()レスポンス本文をバイト配列として返します。getResponseBodyAsString
レスポンスのコンテンツを文字列として返します。使用可能な場合はレスポンスのメディア型の文字セットを使用するか、そうでない場合は UTF-8 にフォールバックします。別のデフォルトの文字セットにフォールバックする場合は、getResponseBodyAsString(Charset)を使用します。getResponseBodyAsString
レスポンスのメディア型から文字セットが利用できない場合に、フォールバックする文字セットを指定できるようにするgetResponseBodyAsString()のバリアント。- パラメーター:
defaultCharset- レスポンスの Content-Type で指定されていない場合に使用する文字セット。- 導入:
- 5.3.7
getResponseBodyAs
エラー内容を指定された型にデコードします。- 型パラメーター:
E- 予想されるターゲット型- パラメーター:
targetType- デコードする型- 戻り値:
- デコードされたコンテンツ、またはコンテンツがない場合は
null - 例外:
IllegalStateExceptionSE- デコーダーが見つからない場合DecodingException- デコードに失敗した場合- 導入:
- 6.0
getResponseBodyAs
- 導入:
- 6.0
getRequest
対応するリクエストを返します。- 導入:
- 5.1.4
setBodyDecodeFunction
指定されたターゲット型のデコーダーを見つける関数を提供します。getResponseBodyAs(Class)で使用します。- パラメーター:
decoderFunction- デコーダーを見つける関数- 導入:
- 6.0
getMessage
- オーバーライド:
- クラス
ThrowableSEのgetMessage
create
public static WebClientResponseException create(int statusCode, StringSE statusText, HttpHeaders headers, byte[] body, @Nullable CharsetSE charset) WebClientResponseExceptionまたは HTTP ステータス固有のサブクラスを作成します。- 導入:
- 5.1
create
public static WebClientResponseException create(int statusCode, StringSE statusText, HttpHeaders headers, byte[] body, @Nullable CharsetSE charset, @Nullable HttpRequest request) WebClientResponseExceptionまたは HTTP ステータス固有のサブクラスを作成します。- 導入:
- 5.1.4
create
public static WebClientResponseException create(HttpStatusCode statusCode, StringSE statusText, HttpHeaders headers, byte[] body, @Nullable CharsetSE charset, @Nullable HttpRequest request) WebClientResponseExceptionまたは HTTP ステータス固有のサブクラスを作成します。- 導入:
- 6.0
getStatusCode()を推奨し、7.0 から削除