# AppFunctionException

Artifact: [androidx.appfunctions:appfunctions](https://developer.android.com/jetpack/androidx/releases/appfunctions) [View Source](https://cs.android.com/search?q=file:androidx/appfunctions/AppFunctionException.kt+class:androidx.appfunctions.AppFunctionException) Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

*** ** * ** ***


```
public abstract class AppFunctionException extends Exception
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [kotlin.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) |||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) ||
|   |   | ↳ | [androidx.appfunctions.AppFunctionException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionException) |

Known direct subclasses [AppFunctionAppException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionAppException), [AppFunctionRequestException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionRequestException), [AppFunctionSystemException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionSystemException), [AppFunctionUnknownException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionUnknownException)

|---|---|
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionAppException` | Thrown when an error is caused by the app providing the function. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionRequestException` | Thrown when the error is caused by the app requesting a function execution. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionSystemException` | Thrown when an internal unexpected error comes from the system. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionUnknownException` | Thrown when an unknown error has occurred. |

Known indirect subclasses [AppFunctionAppUnknownException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionAppUnknownException), [AppFunctionCancelledException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionCancelledException), [AppFunctionDeniedException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionDeniedException), [AppFunctionDisabledException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionDisabledException), [AppFunctionElementAlreadyExistsException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionElementAlreadyExistsException), [AppFunctionElementNotFoundException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionElementNotFoundException), [AppFunctionFunctionNotFoundException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionFunctionNotFoundException), [AppFunctionInvalidArgumentException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionInvalidArgumentException), [AppFunctionLimitExceededException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionLimitExceededException), [AppFunctionNotSupportedException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionNotSupportedException), [AppFunctionPermissionRequiredException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionPermissionRequiredException), [AppFunctionSystemUnknownException](https://developer.android.com/reference/androidx/appfunctions/AppFunctionSystemUnknownException)

|---|---|
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionAppUnknownException` | Thrown when an unknown error occurred while processing the call in the AppFunctionService. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionCancelledException` | Thrown when an operation was cancelled. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionDeniedException` | Thrown when the caller does not have the permission to execute an app function. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionDisabledException` | Thrown when the caller tried to execute a disabled app function. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionElementAlreadyExistsException` | Thrown when the caller tried to create a resource/entity that already exists or has conflicts with existing resource/entity. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionElementNotFoundException` | Thrown when the caller tried to request a resource/entity that does not exist. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionFunctionNotFoundException` | Thrown when the caller tries to execute a function that does not exist. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionInvalidArgumentException` | Thrown when the caller supplied invalid arguments to `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest`'s parameters. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionLimitExceededException` | Thrown when the caller exceeded the allowed request rate. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionNotSupportedException` | Thrown when an app receives a request to perform an unsupported action. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionPermissionRequiredException` | Thrown when the app lacks the necessary permission to fulfill the request. |
| `https://developer.android.com/reference/androidx/appfunctions/AppFunctionSystemUnknownException` | Thrown when an internal unexpected error comes from the system. |

*** ** * ** ***

An exception that is thrown when an error occurs during an app function execution.

This exception can be used by the app to report errors to the caller.

## Summary

| ### Public methods |
|---|---|
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appfunctions/AppFunctionException#getErrorMessage()()` The error message. |

### Inherited methods

From [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) `final void` `https://developer.android.com/reference/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html exception)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#fillInStackTrace()()` `https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#getCause()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `@https://developer.android.com/reference/androidx/annotation/RecentlyNullable
https://developer.android.com/reference/java/lang/Throwable.html#getLocalizedMessage()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getMessage()()` `@https://developer.android.com/reference/androidx/annotation/NonNull StackTraceElement[]` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
https://developer.android.com/reference/java/lang/Throwable.html#getStackTrace()()` `final @https://developer.android.com/reference/androidx/annotation/NonNull Throwable[]` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
https://developer.android.com/reference/java/lang/Throwable.html#getSuppressed()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#initCause(java.lang.Throwable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html cause)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace()()` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace(java.io.PrintStream)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/PrintStream.html s)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace(java.io.PrintWriter)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/PrintWriter.html s)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[])(@https://developer.android.com/reference/androidx/annotation/NonNull StackTraceElement[] stackTrace)`

## Public methods

### getErrorMessage

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

```
public final String getErrorMessage()
```

The error message.