Package com.influxdb.v3.client
Class InfluxDBApiHttpException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.influxdb.v3.client.InfluxDBApiException
com.influxdb.v3.client.InfluxDBApiHttpException
- All Implemented Interfaces:
Serializable
The InfluxDBApiHttpException gets thrown whenever an error status is returned
in the HTTP response. It facilitates recovering from such errors whenever possible.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInfluxDBApiHttpException
(String message, HttpHeaders headers, int statusCode) Construct a new InfluxDBApiHttpException with statusCode and headers.InfluxDBApiHttpException
(Throwable cause, HttpHeaders headers, int statusCode) Construct a new InfluxDBApiHttpException with statusCode and headers. -
Method Summary
Modifier and TypeMethodDescriptionHelper method to simplify retrieval of specific headers.headers()
Gets the HTTP headers property associated with the error.int
Gets the HTTP statusCode associated with the error.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
InfluxDBApiHttpException
public InfluxDBApiHttpException(@Nullable String message, @Nullable HttpHeaders headers, int statusCode) Construct a new InfluxDBApiHttpException with statusCode and headers.- Parameters:
message
- the detail message.headers
- headers returned in the response.statusCode
- statusCode of the response.
-
InfluxDBApiHttpException
public InfluxDBApiHttpException(@Nullable Throwable cause, @Nullable HttpHeaders headers, int statusCode) Construct a new InfluxDBApiHttpException with statusCode and headers.- Parameters:
cause
- root cause of the exception.headers
- headers returned in the response.statusCode
- status code of the response.
-
-
Method Details
-
headers
Gets the HTTP headers property associated with the error.- Returns:
- - the headers object.
-
getHeader
Helper method to simplify retrieval of specific headers.- Parameters:
name
- - name of the header.- Returns:
- - value matching the header key, or null if the key does not exist.
-
statusCode
public int statusCode()Gets the HTTP statusCode associated with the error.- Returns:
- - the HTTP statusCode.
-