Class TokenAcquisitionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.codename1.backend.security.oauth2.client.credentials.TokenAcquisitionException
A token endpoint did not issue a token.
The message names the endpoint, the HTTP status and the OAuth error code,
and nothing else. The request carried a client secret or a signed assertion
and the response may carry a token, so neither body is ever copied into it:
this exception is written to logs and error pages by code that has no idea
what it holds.
-
Constructor Summary
ConstructorsConstructorDescriptionTokenAcquisitionException(String message, int status, String errorCode, boolean retryable, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionThe OAutherrorcode, such asinvalid_grant, or null.intThe HTTP status, or -1 when the endpoint was not reached.booleanTrue for a failure that can go away by itself: the endpoint could not be reached, answered 5xx, or asked to slow down with 429.Methods inherited from class Throwable
addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TokenAcquisitionException
public TokenAcquisitionException(String message, int status, String errorCode, boolean retryable, Throwable cause) - Parameters:
message- what failed, with no secret in itstatus- the HTTP status, or -1 when the endpoint was not reachederrorCode- the OAuth error code the endpoint gave, or nullretryable- whether trying again later can succeedcause- the failure underneath, or null
-
-
Method Details
-
getStatus
public int getStatus()The HTTP status, or -1 when the endpoint was not reached. -
getErrorCode
The OAutherrorcode, such asinvalid_grant, or null. -
isRetryable
public boolean isRetryable()True for a failure that can go away by itself: the endpoint could not be reached, answered 5xx, or asked to slow down with 429. A refused credential (invalid_client,invalid_grant) is not.
-