# HomeException


```
class HomeException : Exception
```

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) |||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) ||
|   |   | ↳ | [com.google.home.HomeException](https://developers.home.google.com/reference/kotlin/com/google/home/HomeException) |

*** ** * ** ***

The exception thrown if any issue is encountered during an API call. Exceptions could be recoverable by the user of the API or unrecoverable. The error code in each exception needs to be documented to showcase the state.

## Summary

| ### Nested types |
|---|
| `object https://developers.home.google.com/reference/kotlin/com/google/home/HomeException.Codes` |
| `object HomeException.Companion` |
| `object HomeException.Companion.AutomationApiErrors` |
| `object HomeException.Companion.HistoryApiErrors` |
| `object https://developers.home.google.com/reference/kotlin/com/google/home/HomeException.Companion.PaginatedApiErrors` |

| ### Public companion functions |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#aborted(kotlin.String,java.lang.Exception,kotlin.Array)(message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError)` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#alreadyExists(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#apiNotConnected(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `[bulkError](https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#bulkError(kotlin.collections.Map))(subErrors: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/HomeError>)` **This function is deprecated.** Use writeFailed or commandFailed methods instead. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#cancelled(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#commandFailed(kotlin.collections.Map)(subErrors: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/HomeError>)` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#cursorWindowNotSupported(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#dataHolderColumnEmpty(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#dataHolderColumnNotFound(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#dataHolderColumnNull(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#dataLoss(kotlin.String,java.lang.Exception,kotlin.Array)(message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError)` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#deadlineExceeded(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#failedPrecondition(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#galError(kotlin.String,java.lang.Exception,kotlin.Array)(message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError)` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#galError(kotlin.String,java.lang.Exception,com.google.home.GalErrorDetails,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, galErrorDetails: https://developers.home.google.com/reference/kotlin/com/google/home/GalErrorDetails?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#historyApiError(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#internal(kotlin.String,java.lang.Exception,kotlin.Array)(message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError)` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#invalidArgument(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#invalidDataHolder(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#notFound(kotlin.String,java.lang.Exception,kotlin.Array)(message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError)` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#outOfRange(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#permissionDenied(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#resourceExhausted(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#sdkInitializationMissingInfo(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#unauthenticated(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#unavailable(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#unimplemented(kotlin.String,java.lang.Exception,kotlin.Array)( message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError )` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#unknown(kotlin.String,java.lang.Exception,kotlin.Array)(message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, vararg subErrors: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError)` |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#writeFailed(kotlin.collections.Map)(subErrors: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/HomeError>)` |

| ### Public constructors |
|---|
| `[HomeException](https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#HomeException(com.google.home.HomeError,java.lang.Exception,kotlin.collections.Map))( error: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError, exception: https://developer.android.com/reference/java/lang/Exception.html?, subErrors: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/HomeError> )` **This function is deprecated.** Use companion methods instead. |
| `[HomeException](https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#HomeException(kotlin.Int,kotlin.String,java.lang.Exception,kotlin.collections.Map))( code: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, exception: https://developer.android.com/reference/java/lang/Exception.html?, subErrors: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/HomeError> )` **This function is deprecated.** Use companion methods instead. |

| ### Public functions |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException?` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#getInnerHomeException()()` Returns the sub exceptions if present. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#getSubErrorCodes()()` Returns the error codes of the sub errors. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#unwrap()()` Returns the first sub error if the error is a command or write error. |

| ### Public properties |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/HomeError` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#error()` the home error that occurred |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/HomeError>` | `https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#subErrors()` any errors that were from sub operations, usually only set for bulk operations |

### Inherited functions

From [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/add-suppressed.html(p0: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/fill-in-stack-trace.html()` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-localized-message.html()` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html>` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-stack-trace.html()` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html>` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-suppressed.html()` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/init-cause.html(p0: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/print-stack-trace.html()` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/print-stack-trace.html(p0: https://developer.android.com/reference/java/io/PrintStream.html)` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/print-stack-trace.html(p0: https://developer.android.com/reference/java/io/PrintWriter.html)` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/set-stack-trace.html(p0: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html>)`

### Inherited properties

From [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html?` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/cause.html` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/message.html`

## Public companion functions

### aborted

```
fun aborted(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### alreadyExists

```
fun alreadyExists(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### apiNotConnected

```
fun apiNotConnected(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### bulkError

```
fun [bulkError](https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#bulkError(kotlin.collections.Map))(subErrors: Map<String, HomeError>): HomeException
```

> [!CAUTION]
> **This function is deprecated.**   
> Use writeFailed or commandFailed methods instead.

Used to inform callers of specific failures during a bulk operation

### cancelled

```
fun cancelled(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### commandFailed

```
fun commandFailed(subErrors: Map<String, HomeError>): HomeException
```

### cursorWindowNotSupported

```
fun cursorWindowNotSupported(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### dataHolderColumnEmpty

```
fun dataHolderColumnEmpty(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### dataHolderColumnNotFound

```
fun dataHolderColumnNotFound(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### dataHolderColumnNull

```
fun dataHolderColumnNull(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### dataLoss

```
fun dataLoss(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### deadlineExceeded

```
fun deadlineExceeded(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### failedPrecondition

```
fun failedPrecondition(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### galError

```
fun galError(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### galError

```
fun galError(
    message: String = "",
    exception: Exception? = null,
    galErrorDetails: GalErrorDetails? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### historyApiError

```
fun historyApiError(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### internal

```
fun internal(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### invalidArgument

```
fun invalidArgument(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### invalidDataHolder

```
fun invalidDataHolder(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### notFound

```
fun notFound(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### outOfRange

```
fun outOfRange(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### permissionDenied

```
fun permissionDenied(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### resourceExhausted

```
fun resourceExhausted(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### sdkInitializationMissingInfo

```
fun sdkInitializationMissingInfo(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### unauthenticated

```
fun unauthenticated(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### unavailable

```
fun unavailable(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### unimplemented

```
fun unimplemented(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### unknown

```
fun unknown(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException
```

### writeFailed

```
fun writeFailed(subErrors: Map<String, HomeError>): HomeException
```

## Public constructors

### HomeException

```
[HomeException](https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#HomeException(com.google.home.HomeError,java.lang.Exception,kotlin.collections.Map))(
    error: HomeError,
    exception: Exception? = null,
    subErrors: Map<String, HomeError> = emptyMap()
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Use companion methods instead.

| Parameters |
|---|---|
| `error: https://developers.home.google.com/reference/kotlin/com/google/home/HomeError` | the home error that occurred |
| `exception: https://developer.android.com/reference/java/lang/Exception.html? = null` | another exception that caused this one |
| `subErrors: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/HomeError> = emptyMap()` | any errors that were from sub operations, usually only set for bulk operations |

### HomeException

```
[HomeException](https://developers.home.google.com/reference/kotlin/com/google/home/HomeException#HomeException(kotlin.Int,kotlin.String,java.lang.Exception,kotlin.collections.Map))(
    code: Int,
    message: String,
    exception: Exception? = null,
    subErrors: Map<String, HomeError> = emptyMap()
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Use companion methods instead.

## Public functions

### getInnerHomeException

```
fun getInnerHomeException(): HomeException?
```

Returns the sub exceptions if present. Otherwise, returns null.

### getSubErrorCodes

```
fun getSubErrorCodes(): List<Int>
```

Returns the error codes of the sub errors. The error codes are returned in the format of \* 100 + . For example, if the parent error code is 13 (INTERNAL) and the sub error code is 5 (STRUCTURE_FLOW_FAILED), the returned value will be 1305.

### unwrap

```
fun unwrap(): HomeException
```

Returns the first sub error if the error is a command or write error. Otherwise, returns the current exception.

## Public properties

### error

```
val error: HomeError
```

the home error that occurred

### subErrors

```
val subErrors: Map<String, HomeError>
```

any errors that were from sub operations, usually only set for bulk operations