- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.helidon.webclient.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, theWebClientResponse
is available to obtain any needed details. If the exception was caused before data was sent, or due to timeouts, socket exceptions etc., theWebClientResponse
is not present and exception handling must be based on the wrapped exception.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WebClientException(String message)
Creates new instance of web client exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<WebClientResponse>
response()
WebClientResponse
that caused this exception if caused by response from server.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
WebClientException
public WebClientException(String message)
Creates new instance of web client exception.- Parameters:
message
- exception message
-
-
Method Detail
-
response
public Optional<WebClientResponse> response()
WebClientResponse
that caused this exception if caused by response from server. Otherwise an emptyOptional
.- Returns:
- ClientResponse if this client request reached the moment when a response is received.
-
-