# 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
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/kotlin/androidx/car/app/IOnDoneCallback`

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/FailureResponse#BUNDLER_EXCEPTION() = 1` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/FailureResponse#ILLEGAL_STATE_EXCEPTION() = 2` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/FailureResponse#INVALID_PARAMETER_EXCEPTION() = 3` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/FailureResponse#REMOTE_EXCEPTION() = 6` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/FailureResponse#RUNTIME_EXCEPTION() = 5` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/FailureResponse#SECURITY_EXCEPTION() = 4` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/FailureResponse#UNKNOWN_ERROR() = 0` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/FailureResponse#FailureResponse(java.lang.Throwable)(exception: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)` Creates an instance of `https://developer.android.com/reference/kotlin/androidx/car/app/FailureResponse`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/FailureResponse#equals(java.lang.Object)(obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/FailureResponse#getErrorType()()` Returns the type of the originating exception. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/FailureResponse#getStackTrace()()` Returns the stack trace of the originating exception. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/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)

```
const val BUNDLER_EXCEPTION = 1: Int
```

### ILLEGAL_STATE_EXCEPTION

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

```
const val ILLEGAL_STATE_EXCEPTION = 2: Int
```

### INVALID_PARAMETER_EXCEPTION

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

```
const val INVALID_PARAMETER_EXCEPTION = 3: Int
```

### REMOTE_EXCEPTION

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

```
const val REMOTE_EXCEPTION = 6: Int
```

### RUNTIME_EXCEPTION

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

```
const val RUNTIME_EXCEPTION = 5: Int
```

### SECURITY_EXCEPTION

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

```
const val SECURITY_EXCEPTION = 4: Int
```

### UNKNOWN_ERROR

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

```
const val UNKNOWN_ERROR = 0: Int
```

## Public constructors

### FailureResponse

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

```
FailureResponse(exception: Throwable)
```

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

| Parameters |
|---|---|
| `exception: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html` | the originating cause of the failure |

## Public functions

### equals

```
fun equals(obj: Any?): Boolean
```

### getErrorType

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

```
fun getErrorType(): Int
```

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)

```
fun getStackTrace(): String
```

Returns the stack trace of the originating exception.

### hashCode

```
fun hashCode(): Int
```