public class TokenResponseException extends HttpResponseException
To get the structured details, use getDetails()
.
Sample usage can be found for AuthorizationCodeTokenRequest
.
HttpResponseException.Builder
Modifier and Type | Method and Description |
---|---|
static TokenResponseException |
from(JsonFactory jsonFactory,
HttpResponse response)
Returns a new instance of
TokenResponseException . |
TokenErrorResponse |
getDetails()
Returns the token error response details or
null if unable to parse. |
computeMessageBuffer, getAttemptCount, getContent, getHeaders, getStatusCode, getStatusMessage, isSuccessStatusCode
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public final TokenErrorResponse getDetails()
null
if unable to parse.public static TokenResponseException from(JsonFactory jsonFactory, HttpResponse response)
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.
jsonFactory
- JSON factoryresponse
- HTTP responseTokenErrorResponse
Copyright © 2011–2022 Google. All rights reserved.