|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.io.IOException
com.google.api.client.http.HttpResponseException
com.google.api.client.googleapis.json.GoogleJsonResponseException
public class GoogleJsonResponseException
Exception thrown when an error status code is detected in an HTTP response to a Google API that uses the JSON format, using the format specified in Error Messages in Google Buzz.
To get the structured details, use getDetails().
| Method Summary | |
|---|---|
static GoogleJsonResponseException |
from(JsonFactory jsonFactory,
HttpResponse response)
Returns a new instance of GoogleJsonResponseException. |
GoogleJsonError |
getDetails()
Returns the Google JSON error details or null for none (for example if response is not
JSON). |
JsonFactory |
getJsonFactory()
Returns the JSON factory. |
| Methods inherited from class com.google.api.client.http.HttpResponseException |
|---|
computeMessage, getResponse |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public final GoogleJsonError getDetails()
null for none (for example if response is not
JSON).
public final JsonFactory getJsonFactory()
public static GoogleJsonResponseException from(JsonFactory jsonFactory,
HttpResponse response)
GoogleJsonResponseException.
If there is a JSON error response, it is parsed using GoogleJsonError, which can be
inspected using getDetails(). Otherwise, response content (if any) is read and
ignored. Either way, any content is already parsed, and trying to parse
HttpResponse.getContent() of HttpResponseException.getResponse() will likely result in an
IOException.
jsonFactory - JSON factoryresponse - HTTP response
GoogleJsonResponseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||