Class ConsulException

All Implemented Interfaces:
Serializable

public class ConsulException extends RuntimeException
Wraps an exception thrown whilst interacting with the Consul API.
See Also:
  • Constructor Details

    • ConsulException

      public ConsulException(String message)
      Constructs an instance of this class.
      Parameters:
      message - The exception message.
    • ConsulException

      public ConsulException(String message, Throwable throwable)
      Constructs an instance of this class.
      Parameters:
      message - The exception message.
      throwable - The wrapped Throwable object.
    • ConsulException

      public ConsulException(int code, retrofit2.Response<?> response)
    • ConsulException

      public ConsulException(Throwable throwable)
  • Method Details

    • hasCode

      public boolean hasCode()
      Check whether this exception is known to have been caused by an HTTP error.
      Returns:
      true if this exception was definitely caused by an HTTP error, otherwise false
      See Also:
    • getCode

      public int getCode()
      Get the HTTP status code that caused this exception, if any.
      Returns:
      the HTTP error code, or zero if not known to have been caused by an HTTP error
      See Also: