Package me.ahoo.cosid.store.remote
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 Summary
ConstructorsConstructorDescriptionRemoteStoreException(int status, String code, String message) An error the server answered.RemoteStoreException(int status, String code, String message, Throwable cause) An error the server answered, with a cause on this side, such as theStoreTimeoutExceptionof astore_timeout.RemoteStoreException(String message, Throwable cause) A call that got no answer. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RemoteStoreException
An error the server answered.- Parameters:
status- the HTTP statuscode- thecodeof the error body;nullif the body had nonemessage- the message
-
RemoteStoreException
An error the server answered, with a cause on this side, such as theStoreTimeoutExceptionof astore_timeout.- Parameters:
status- the HTTP statuscode- thecodeof the error bodymessage- the messagecause- the cause
-
RemoteStoreException
A call that got no answer.- Parameters:
message- the messagecause- the cause
-
-
Method Details
-
status
public int status()The HTTP status.- Returns:
- the status; 0 when the server did not answer
-
code
The error code (RemoteApi).- Returns:
- the code;
nullwhen 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
-