public class GoogleJsonError
extends com.google.api.client.json.GenericJson
Modifier and Type | Class and Description |
---|---|
static class |
GoogleJsonError.ErrorInfo
Detailed error information.
|
com.google.api.client.util.GenericData.Flags
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
GoogleJsonError() |
Modifier and Type | Method and Description |
---|---|
GoogleJsonError |
clone() |
int |
getCode()
Returns the HTTP status code of this response or
null for none. |
List<GoogleJsonError.ErrorInfo> |
getErrors()
Returns the list of detailed errors or
null for none. |
String |
getMessage()
Returns the human-readable explanation of the error or
null for none. |
static GoogleJsonError |
parse(com.google.api.client.json.JsonFactory jsonFactory,
com.google.api.client.http.HttpResponse response)
Parses the given error HTTP response using the given JSON factory.
|
GoogleJsonError |
set(String fieldName,
Object value) |
void |
setCode(int code)
Sets the HTTP status code of this response or
null for none. |
void |
setErrors(List<GoogleJsonError.ErrorInfo> errors)
Sets the list of detailed errors or
null for none. |
void |
setMessage(String message)
Sets the human-readable explanation of the error or
null for none. |
getFactory, setFactory, toPrettyString, toString
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
clear, containsKey, containsValue, isEmpty, keySet, size, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public static GoogleJsonError parse(com.google.api.client.json.JsonFactory jsonFactory, com.google.api.client.http.HttpResponse response) throws IOException
jsonFactory
- JSON factoryresponse
- HTTP responseIllegalArgumentException
- if content type is not Json.MEDIA_TYPE
or if expected
"data"
or "error"
key is not foundIOException
public final List<GoogleJsonError.ErrorInfo> getErrors()
null
for none.public final void setErrors(List<GoogleJsonError.ErrorInfo> errors)
null
for none.public final int getCode()
null
for none.public final void setCode(int code)
null
for none.public final String getMessage()
null
for none.public final void setMessage(String message)
null
for none.public GoogleJsonError set(String fieldName, Object value)
set
in class com.google.api.client.json.GenericJson
public GoogleJsonError clone()
clone
in class com.google.api.client.json.GenericJson
Copyright © 2010–2019 Google. All rights reserved.