Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public class TokenAcquisitionException
- Object
- Throwable
- Exception
- RuntimeException
- 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.
Constructors
public TokenAcquisitionException(String message, int status, String errorCode, boolean retryable, Throwable cause) |
Methods
public int getStatus() | The HTTP status, or -1 when the endpoint was not reached. |
public String getErrorCode() | The OAuth error code, such as invalid_grant, or null. |
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. |
Inherited methods
Constructor details
TokenAcquisitionException
public TokenAcquisitionException(String message, int status, String errorCode, boolean retryable, Throwable cause)Parameters
messageString- what failed, with no secret in it
statusint- the HTTP status, or -1 when the endpoint was not reached
errorCodeString- the OAuth error code the endpoint gave, or null
retryableboolean- whether trying again later can succeed
causeThrowable- the failure underneath, or null
Method details
getStatus
public int getStatus()The HTTP status, or -1 when the endpoint was not reached.
getErrorCode
public String getErrorCode()The OAuth
error code, such as invalid_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.