Class AltsException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
lol.trq.alts.AltsException
- All Implemented Interfaces:
Serializable
The one exception the library throws for a failure, and the only one a library future completes
with exceptionally (inside the JDK's
CompletionException).
Branch on failure().kind(). The message is AltsFailure.message(): built by the
library, never a transport exception's text, a token or a path. The underlying failure, where there
was one, is kept as the cause for a host that wants to log it deliberately;
its own message may quote a credential, so it is never shown.
Java serialization does not carry the AltsFailure: an instance is not serializable.
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAltsException(AltsFailure failure) Creates an exception carryingfailure.AltsException(AltsFailure.Kind kind, String message) Creates an exception carrying a fresh failure ofkind.AltsException(AltsFailure failure, Throwable cause) Creates an exception carryingfailureand the underlying failure it was classified from. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
AltsException
Creates an exception carryingfailure.- Parameters:
failure- what went wrong- Throws:
NullPointerException- iffailureis null- Since:
- 1.0.0
-
AltsException
Creates an exception carryingfailureand the underlying failure it was classified from.- Parameters:
failure- what went wrongcause- the underlying failure, ornull- Throws:
NullPointerException- iffailureis null- Since:
- 1.0.0
-
AltsException
Creates an exception carrying a fresh failure ofkind.- Parameters:
kind- what kind of failure it ismessage- a short description built by the library- Since:
- 1.0.0
-
-
Method Details
-
failure
-
kind
Returns the kind of failure, shorthand forfailure().kind().- Returns:
- the kind
- Since:
- 1.0.0
-