# FailureResponse

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/FailureResponse.java+class:androidx.car.app.FailureResponse) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@CarProtocol
public final class FailureResponse
```

<br />

*** ** * ** ***

Denotes a failure in the client to a host request.

This is used for the failure response for an `https://developer.android.com/reference/androidx/car/app/IOnDoneCallback`

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/car/app/FailureResponse#BUNDLER_EXCEPTION() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/FailureResponse#ILLEGAL_STATE_EXCEPTION() = 2` |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/FailureResponse#INVALID_PARAMETER_EXCEPTION() = 3` |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/FailureResponse#REMOTE_EXCEPTION() = 6` |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/FailureResponse#RUNTIME_EXCEPTION() = 5` |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/FailureResponse#SECURITY_EXCEPTION() = 4` |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/FailureResponse#UNKNOWN_ERROR() = 0` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/car/app/FailureResponse#FailureResponse(java.lang.Throwable)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Throwable.html exception)` Creates an instance of `https://developer.android.com/reference/androidx/car/app/FailureResponse`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/FailureResponse#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html obj)` |
| `int` | `https://developer.android.com/reference/androidx/car/app/FailureResponse#getErrorType()()` Returns the type of the originating exception. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/FailureResponse#getStackTrace()()` Returns the stack trace of the originating exception. |
| `int` | `https://developer.android.com/reference/androidx/car/app/FailureResponse#hashCode()()` |

## Constants

### BUNDLER_EXCEPTION

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int BUNDLER_EXCEPTION = 1
```

### ILLEGAL_STATE_EXCEPTION

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int ILLEGAL_STATE_EXCEPTION = 2
```

### INVALID_PARAMETER_EXCEPTION

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int INVALID_PARAMETER_EXCEPTION = 3
```

### REMOTE_EXCEPTION

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int REMOTE_EXCEPTION = 6
```

### RUNTIME_EXCEPTION

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int RUNTIME_EXCEPTION = 5
```

### SECURITY_EXCEPTION

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int SECURITY_EXCEPTION = 4
```

### UNKNOWN_ERROR

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int UNKNOWN_ERROR = 0
```

## Public constructors

### FailureResponse

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public FailureResponse(@NonNull Throwable exception)
```

Creates an instance of `https://developer.android.com/reference/androidx/car/app/FailureResponse`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Throwable.html exception` | the originating cause of the failure |

## Public methods

### equals

```
public boolean equals(@Nullable Object obj)
```

### getErrorType

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public int getErrorType()
```

Returns the type of the originating exception.

### getStackTrace

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @NonNull String getStackTrace()
```

Returns the stack trace of the originating exception.

### hashCode

```
public int hashCode()
```