2.9.3 (latest) 2.9.2 2.8.1 2.7.2 2.6.0 2.5.1 2.4.1 2.1.2 2.0.1 1.35.2 1.34.1 1.33.4

```java
public class GoogleJsonError extends GenericJson
```
Data class representing the Google JSON error response content, as documented for example in [Error responses](https://cloud.google.com/apis/design/errors).

## Inheritance

[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> 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\>) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-) [AbstractMap.clear()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#clear--) [AbstractMap.containsKey(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#containsKey-java.lang.Object-) [AbstractMap.containsValue(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#containsValue-java.lang.Object-) [AbstractMap.isEmpty()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#isEmpty--) [AbstractMap.keySet()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#keySet--) [AbstractMap.put(K,V)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#put-K-V-) [AbstractMap.putAll(Map\<? extends K,? extends V\>)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#putAll-java.util.Map<? extends K-? extends V>-) [AbstractMap.size()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#size--) [AbstractMap.values()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#values--)

## Static Methods

### parse(JsonFactory jsonFactory, HttpResponse response)

```java
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()

```java
public GoogleJsonError()
```

## Methods

### clone()

```java
public GoogleJsonError clone()
```

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `GoogleJsonError` |   |

**Overrides** com.google.api.client.json.GenericJson.clone()

### getCode()

```java
public final int getCode()
```
Returns the HTTP status code of this response or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### getDetails()

```java
public List<GoogleJsonError.Details> getDetails()
```

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `List<Details>` |   |

### getErrors()

```java
public final List<GoogleJsonError.ErrorInfo> getErrors()
```
Returns the list of detailed errors or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `List<ErrorInfo>` |   |

### getMessage()

```java
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)

```java
public GoogleJsonError set(String fieldName, Object value)
```

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `fieldName` | `String` |
| `value` | `Object` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `GoogleJsonError` |   |

**Overrides** com.google.api.client.json.GenericJson.set(java.lang.String,java.lang.Object)

### setCode(int code)

```java
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)

```java
public void setDetails(List<GoogleJsonError.Details> details)
```
Sets the list of invalid parameter error details as immutable to prevent exposing mutable
state.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `details` | `List<Details>` |

### setErrors(List\<GoogleJsonError.ErrorInfo\> errors)

```java
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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `errors` | `List<ErrorInfo>` |

### setMessage(String message)

```java
public final void setMessage(String message)
```
Sets the human-readable explanation of the error or `null` for none.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `message` | `String` |