クラス NoOpResponseErrorHandler

java.lang.ObjectSE
org.springframework.web.client.NoOpResponseErrorHandler
実装されたすべてのインターフェース:
ResponseErrorHandler

public final class NoOpResponseErrorHandler extends ObjectSE implements ResponseErrorHandler
RestTemplate または RestClient を使用してエラーを無視するのに適した、基本的な操作なしの ResponseErrorHandler 実装。

この実装は、最初に一致する候補が呼び出される候補リストを使用するため、RestClient には適していません。RestClient を使用してデフォルトのステータスハンドラーを無効にする場合は、すべてのステータスコードに一致する述語を持つ noop ErrorHandler を登録することを検討してください (RestClient.Builder.defaultStatusHandler(Predicate, ErrorHandler) を参照)。

導入:
6.1.7
作成者:
Stephane Nicoll
  • コンストラクターの詳細

    • NoOpResponseErrorHandler

      public NoOpResponseErrorHandler()
  • メソッドの詳細

    • hasError

      public boolean hasError(ClientHttpResponse response) throws IOExceptionSE
      インターフェースからコピーされた説明: ResponseErrorHandler
      指定されたレスポンスにエラーがあるかどうかを示します。

      実装は通常、レスポンスの HttpStatus をインスペクションします。

      次で指定:
      インターフェース ResponseErrorHandlerhasError 
      パラメーター:
      response - インスペクションするレスポンス
      戻り値:
      レスポンスがエラーを示す場合、true。それ以外の場合は false 
      例外:
      IOExceptionSE - I/O エラーの場合