Class Tm1Exception
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.skipcheck.tm1.client.error.Tm1Exception
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Tm1ApiException, Tm1ProtocolException, Tm1TransportException, Tm1UnsupportedOperationException
public abstract sealed class Tm1Exception
extends RuntimeException
permits Tm1ApiException, Tm1TransportException, Tm1ProtocolException, Tm1UnsupportedOperationException
Something went wrong talking to TM1. The root of all the client's exceptions;
unchecked.
Tm1ApiException: TM1 answered with an error.Tm1TransportException: no complete answer, e.g. connection refused or timed out.Tm1ProtocolException: an answer the client couldn't read, including errors that happened after TM1 had started a successful response.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTm1Exception(String message, @Nullable String method, @Nullable String url, @Nullable Throwable cause) Creates an exception for a failed request. -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanWhether sending the same request again could succeed, such as after a timeout or a 503.abstract booleanWhether the request may have taken effect on TM1 even though it failed.@Nullable Stringmethod()The request's HTTP method, ornullif not known.@Nullable Stringurl()The request's URL, never including credentials, ornullif not known.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
Tm1Exception
protected Tm1Exception(String message, @Nullable String method, @Nullable String url, @Nullable Throwable cause) Creates an exception for a failed request.- Parameters:
message- the detail messagemethod- the request's HTTP method, ornullif not knownurl- the request's URL, without credentials, ornullif not knowncause- the underlying failure, ornull
-
-
Method Details
-
isRetryable
public abstract boolean isRetryable()Whether sending the same request again could succeed, such as after a timeout or a 503.- Returns:
trueif a retry could succeed
-
mayHaveApplied
public abstract boolean mayHaveApplied()Whether the request may have taken effect on TM1 even though it failed. False only when TM1 certainly didn't act on it, such as a connection that was never made, or a request it rejected. Check this before retrying anything that isn't idempotent, like running a process.- Returns:
falseonly if TM1 certainly didn't act on the request
-
method
The request's HTTP method, ornullif not known.- Returns:
- the HTTP method, or
null
-
url
The request's URL, never including credentials, ornullif not known.- Returns:
- the URL, or
null
-