Class WebClientException

All Implemented Interfaces:
Serializable

public class WebClientException extends RuntimeException
An exception that caused this client request to fail. If the exception is based on status or content of response from server, the WebClientResponse is available to obtain any needed details. If the exception was caused before data was sent, or due to timeouts, socket exceptions etc., the WebClientResponse is not present and exception handling must be based on the wrapped exception.
See Also:
  • Constructor Details

    • WebClientException

      public WebClientException(String message)
      Creates new instance of web client exception.
      Parameters:
      message - exception message
  • Method Details

    • response

      public Optional<WebClientResponse> response()
      WebClientResponse that caused this exception if caused by response from server. Otherwise an empty Optional.
      Returns:
      ClientResponse if this client request reached the moment when a response is received.