Send feedback
Class GoogleJsonError (2.4.1)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.4.1 keyboard_arrow_down
public class GoogleJsonError extends GenericJson
Data class representing the Google JSON error response content, as documented for example in Error responses .
Inheritance
Object >
java.util.AbstractMap >
com.google.api.client.util.GenericData >
com.google.api.client.json.GenericJson >
GoogleJsonError
Inherited Members
com.google.api.client.json.GenericJson.clone()
com.google.api.client.json.GenericJson.getFactory()
com.google.api.client.json.GenericJson.set(java.lang.String,java.lang.Object)
com.google.api.client.json.GenericJson.setFactory(com.google.api.client.json.JsonFactory)
com.google.api.client.json.GenericJson.toPrettyString()
com.google.api.client.json.GenericJson.toString()
com.google.api.client.util.GenericData.entrySet()
com.google.api.client.util.GenericData.equals(java.lang.Object)
com.google.api.client.util.GenericData.get(java.lang.Object)
com.google.api.client.util.GenericData.getClassInfo()
com.google.api.client.util.GenericData.getUnknownKeys()
com.google.api.client.util.GenericData.hashCode()
com.google.api.client.util.GenericData.put(java.lang.String,java.lang.Object)
com.google.api.client.util.GenericData.putAll(java.util.Map<? extends java.lang.String,?>)
com.google.api.client.util.GenericData.remove(java.lang.Object)
com.google.api.client.util.GenericData.setUnknownKeys(java.util.Map<java.lang.String,java.lang.Object>)
Static Methods
parse(JsonFactory jsonFactory, HttpResponse response)
public static GoogleJsonError parse ( JsonFactory jsonFactory , HttpResponse response )
Parses the given error HTTP response using the given JSON factory.
Parameters
Name
Description
jsonFactory
com.google.api.client.json.JsonFactory
JSON factory
response
com.google.api.client.http.HttpResponse
HTTP response
Returns
Type
Description
GoogleJsonError
new instance of the Google JSON error information
Exceptions
Type
Description
IOException
if content type is not Json#MEDIA_TYPE or if expected
"data"
or "error"
key is not found
Constructors
GoogleJsonError()
Methods
clone()
public GoogleJsonError clone ()
Overrides
com.google.api.client.json.GenericJson.clone()
getCode()
public final int getCode ()
Returns the HTTP status code of this response or null
for none.
Returns
Type
Description
int
getDetails()
public List<GoogleJsonError . Details > getDetails ()
getErrors()
public final List<GoogleJsonError . ErrorInfo > getErrors ()
Returns the list of detailed errors or null
for none.
getMessage()
public final String getMessage ()
Returns the human-readable explanation of the error or null
for none.
Returns
Type
Description
String
set(String fieldName, Object value)
public GoogleJsonError set ( String fieldName , Object value )
Overrides
com.google.api.client.json.GenericJson.set(java.lang.String,java.lang.Object)
setCode(int code)
public final void setCode ( int code )
Sets the HTTP status code of this response or null
for none.
Parameter
Name
Description
code
int
setDetails(List<GoogleJsonError.Details> details)
public void setDetails ( List<GoogleJsonError . Details > details )
Sets the list of invalid parameter error details as immutable to prevent exposing mutable
state.
setErrors(List<GoogleJsonError.ErrorInfo> errors)
public final void setErrors ( List<GoogleJsonError . ErrorInfo > errors )
Sets the list of detailed errors or null
for none. Sets the list of detailed errors as
immutable to prevent exposing mutable state.
setMessage(String message)
public final void setMessage ( String message )
Sets the human-readable explanation of the error or null
for none.
Parameter
Name
Description
message
String
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-28 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-28 UTC."],[],[]]