Class HttpClientException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.micronaut.http.exceptions.HttpException
-
- io.micronaut.http.client.exceptions.HttpClientException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ContentLengthExceededException,EmptyResponseException,HttpClientResponseException,NoHostException,ReadTimeoutException
public class HttpClientException extends io.micronaut.http.exceptions.HttpExceptionParent class for all HTTP client exceptions.- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HttpClientException(java.lang.String message)HttpClientException(java.lang.String message, java.lang.Throwable cause)HttpClientException(java.lang.String message, java.lang.Throwable cause, boolean shared)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetMessage()java.lang.StringgetServiceId()Get the service ID of the http client that produced this exception.voidsetServiceId(java.lang.String serviceId)Set the service id that produced this exception.
-
-
-
Constructor Detail
-
HttpClientException
public HttpClientException(java.lang.String message)
- Parameters:
message- The message
-
HttpClientException
public HttpClientException(java.lang.String message, java.lang.Throwable cause)- Parameters:
message- The messagecause- The throwable
-
HttpClientException
public HttpClientException(java.lang.String message, java.lang.Throwable cause, boolean shared)- Parameters:
message- The messagecause- The throwableshared- Shared instance
-
-
Method Detail
-
getServiceId
@Nullable public final java.lang.String getServiceId()
Get the service ID of the http client that produced this exception.- Returns:
- The service ID of the client
-
setServiceId
@Internal public final void setServiceId(java.lang.String serviceId)
Set the service id that produced this exception.- Parameters:
serviceId- The service id- Throws:
java.lang.IllegalStateException- If the service ID has already been set, or this is a shared exception (e.g.ReadTimeoutException).
-
getMessage
public java.lang.String getMessage()
- Overrides:
getMessagein classjava.lang.Throwable
-
-