Class HealthException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.codename1.health.HealthException
The failure delivered through an AsyncResource when a health
operation does not succeed. Branch on getError() rather than on the
message.
store.write(sample).onResult((res, err) -> {
if (err instanceof HealthException) {
HealthError e = ((HealthException) err).getError();
if (e == HealthError.UNAUTHORIZED) {
Health.getInstance().openHealthSettings();
}
}
});
-
Constructor Summary
ConstructorsConstructorDescriptionHealthException(HealthError error, String message) Creates an exception carrying a typed reason.HealthException(HealthError error, String message, Throwable cause) Creates an exception carrying a typed reason and an underlying cause. -
Method Summary
Methods inherited from class Throwable
addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString
-
Constructor Details
-
HealthException
Creates an exception carrying a typed reason. -
HealthException
Creates an exception carrying a typed reason and an underlying cause.
-
-
Method Details
-
getError
The typed reason this operation failed.
-