Class InfluxDBApiHttpException

All Implemented Interfaces:
Serializable

public class InfluxDBApiHttpException extends InfluxDBApiException
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 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

      public HttpHeaders headers()
      Gets the HTTP headers property associated with the error.
      Returns:
      - the headers object.
    • getHeader

      public List<String> getHeader(String name)
      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.