public class TokenResponseException extends HttpResponseExceptionException thrown when receiving an error response from the token server as specified in Error Response
To get the structured details, use #getDetails().
Sample usage can be found for AuthorizationCodeTokenRequest.
Static Methods
from(JsonFactory jsonFactory, HttpResponse response)
public static TokenResponseException from(JsonFactory jsonFactory, HttpResponse response)Returns a new instance of TokenResponseException.
If there is a JSON error response, it is parsed using TokenErrorResponse, which can be inspected using #getDetails(). Otherwise, the full response content is read and included in the exception message.
| Name | Description |
| jsonFactory | com.google.api.client.json.JsonFactoryJSON factory |
| response | com.google.api.client.http.HttpResponseHTTP response |
| Type | Description |
| TokenResponseException | new instance of TokenErrorResponse |
Methods
getDetails()
public final TokenErrorResponse getDetails()Returns the token error response details or null if unable to parse.
| Type | Description |
| TokenErrorResponse |