Class WaiterFailedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.eqixiac.equinix.core.waiter.WaiterException
com.eqixiac.equinix.core.waiter.WaiterFailedException
- All Implemented Interfaces:
Serializable
Thrown by
ResourceWaiter.await() when the resource reaches a terminal failure state
(the configured failWhen condition) before succeeding. Carries the failed resource.- Author:
- ianjones
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TgetResource(Class<T> type) Typed convenience accessor for the failed resource, e.g.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
WaiterFailedException
-
-
Method Details
-
getResource
- Returns:
- the resource in its failure state, or
null(alwaysnullafter serialization, as the payload is transient)
-
getResource
Typed convenience accessor for the failed resource, e.g.ex.getResource(Connection.class).- Type Parameters:
T- the expected resource type- Parameters:
type- the expected resource type- Returns:
- the resource cast to
type, ornullif absent - Throws:
ClassCastException- if the resource is not of the given type
-