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:
Serializable
- Direct Known Subclasses:
ContentLengthExceededException
,EmptyResponseException
,HttpClientResponseException
,NoHostException
,ReadTimeoutException
Parent class for all HTTP client exceptions.
- Since:
- 1.0
- Author:
- Graeme Rocher
- See Also:
-
Constructor Summary
ConstructorDescriptionHttpClientException
(String message) HttpClientException
(String message, Throwable cause) HttpClientException
(String message, Throwable cause, boolean shared) -
Method Summary
Modifier and TypeMethodDescriptionGet the service ID of the http client that produced this exception.final void
setServiceId
(String serviceId) Set the service id that produced this exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
HttpClientException
- Parameters:
message
- The message
-
HttpClientException
- Parameters:
message
- The messagecause
- The throwable
-
HttpClientException
- Parameters:
message
- The messagecause
- The throwableshared
- Shared instance
-
-
Method Details
-
getServiceId
Get the service ID of the http client that produced this exception.- Returns:
- The service ID of the client
-
setServiceId
Set the service id that produced this exception.- Parameters:
serviceId
- The service id- Throws:
IllegalStateException
- If the service ID has already been set, or this is a shared exception (e.g.ReadTimeoutException
).
-
getMessage
- Overrides:
getMessage
in classThrowable
-