Class RemoteStoreException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
me.ahoo.cosid.CosIdException
me.ahoo.cosid.store.remote.RemoteStoreException
All Implemented Interfaces:
Serializable

public class RemoteStoreException extends me.ahoo.cosid.CosIdException
A call to cosid-server failed: the server answered with an error the primitive has no outcome for (a 401, 403, 429, 503, 5xx, ...), or the call itself failed (connection, timeout).
See Also:
  • Constructor Details

    • RemoteStoreException

      public RemoteStoreException(int status, String code, String message)
      An error the server answered.
      Parameters:
      status - the HTTP status
      code - the code of the error body; null if the body had none
      message - the message
    • RemoteStoreException

      public RemoteStoreException(int status, String code, String message, Throwable cause)
      An error the server answered, with a cause on this side, such as the StoreTimeoutException of a store_timeout.
      Parameters:
      status - the HTTP status
      code - the code of the error body
      message - the message
      cause - the cause
    • RemoteStoreException

      public RemoteStoreException(String message, Throwable cause)
      A call that got no answer.
      Parameters:
      message - the message
      cause - the cause
  • Method Details

    • status

      public int status()
      The HTTP status.
      Returns:
      the status; 0 when the server did not answer
    • code

      public String code()
      The error code (RemoteApi).
      Returns:
      the code; null when the server did not answer or sent none
    • transientFailure

      public boolean transientFailure()
      Whether calling again later may succeed: the server was busy (503), its store timed out (504), or it did not answer.
      Returns:
      whether the failure is transient