Class TokenResponseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.io.IOException
-
- com.google.api.client.http.HttpResponseException
-
- com.google.api.client.auth.oauth2.TokenResponseException
-
- All Implemented Interfaces:
java.io.Serializable
public class TokenResponseException extends com.google.api.client.http.HttpResponseExceptionException thrown when receiving an error response from the token server as specified in Error ResponseTo get the structured details, use
getDetails().Sample usage can be found for
AuthorizationCodeTokenRequest.- Since:
- 1.7
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private TokenErrorResponsedetailsToken error response details ornullif unable to parse.private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description TokenResponseException(com.google.api.client.http.HttpResponseException.Builder builder, TokenErrorResponse details)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TokenResponseExceptionfrom(com.google.api.client.json.JsonFactory jsonFactory, com.google.api.client.http.HttpResponse response)Returns a new instance ofTokenResponseException.TokenErrorResponsegetDetails()Returns the token error response details ornullif unable to parse.-
Methods inherited from class com.google.api.client.http.HttpResponseException
computeMessageBuffer, getContent, getHeaders, getStatusCode, getStatusMessage, isSuccessStatusCode
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
details
private final transient TokenErrorResponse details
Token error response details ornullif unable to parse.
-
-
Constructor Detail
-
TokenResponseException
TokenResponseException(com.google.api.client.http.HttpResponseException.Builder builder, TokenErrorResponse details)- Parameters:
builder- builderdetails- token error response details ornullif unable to parse
-
-
Method Detail
-
getDetails
public final TokenErrorResponse getDetails()
Returns the token error response details ornullif unable to parse.
-
from
public static TokenResponseException from(com.google.api.client.json.JsonFactory jsonFactory, com.google.api.client.http.HttpResponse response)
Returns a new instance ofTokenResponseException.If there is a JSON error response, it is parsed using
TokenErrorResponse, which can be inspected usinggetDetails(). Otherwise, the full response content is read and included in the exception message.- Parameters:
jsonFactory- JSON factoryresponse- HTTP response- Returns:
- new instance of
TokenErrorResponse
-
-