Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#constants) \| [Inherited Constants](https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#inhconstants) \| [Fields](https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#lfields) \| [Ctors](https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#pubctors) \| [Methods](https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#inhmethods)

# AppFunctionException

*** ** * ** ***


`
public

final

class
AppFunctionException
`


`


`

`


`

`

extends https://developer.android.com/reference/java/lang/Exception


`

`


implements

https://developer.android.com/reference/android/os/Parcelable


`

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

<br />

*** ** * ** ***

App function related error.

This exception may include a `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#getExtras()` containing
additional error-specific metadata.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_APP_UNKNOWN_ERROR` An unknown error occurred while processing the call in the AppFunctionService. |
| `int` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CANCELLED` The operation was cancelled. |
| `int` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_APP` The error is caused by the app providing the function. |
| `int` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_REQUEST_ERROR` The error is caused by the app requesting a function execution. |
| `int` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_SYSTEM` The error is caused by an issue in the system. |
| `int` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_UNKNOWN` The error category is unknown. |
| `int` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_DENIED` The caller does not have the permission to execute an app function. |
| `int` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_DISABLED` The caller tried to execute a disabled app function. |
| `int` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_ENTERPRISE_POLICY_DISALLOWED` The operation was disallowed by enterprise policy. |
| `int` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_FUNCTION_NOT_FOUND` The caller tried to execute a function that does not exist. |
| `int` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_INVALID_ARGUMENT` The caller supplied invalid arguments to the execution request. |
| `int` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_SYSTEM_ERROR` An internal unexpected error coming from the system. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that
the Parcelable object's flattened representation includes a file descriptor.


`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written
is a return value, that is the result of a function such as
"`Parcelable someFunction()`",
"`void someFunction(out Parcelable)`", or
"`void someFunction(inout Parcelable)`".


| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/app/appfunctions/AppFunctionException>` | `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#CREATOR` |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#AppFunctionException(int,%20java.lang.String)(int errorCode, https://developer.android.com/reference/java/lang/String errorMessage) ` |
| ` https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#AppFunctionException(int,%20java.lang.String,%20android.os.Bundle)(int errorCode, https://developer.android.com/reference/java/lang/String errorMessage, https://developer.android.com/reference/android/os/Bundle extras) ` |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` int` | ` https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#getErrorCategory()() ` Returns the error category. |
| ` int` | ` https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#getErrorCode()() ` Returns one of the `ERROR` constants. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#getErrorMessage()() ` Returns the error message. |
| ` https://developer.android.com/reference/android/os/Bundle` | ` https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#getExtras()() ` Returns any extras associated with this error. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#getMessage()() ` Returns the detail message string of this throwable. |
| ` void` | ` https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Throwable

` `


final

void` `
https://developer.android.com/reference/java/lang/Throwable#addSuppressed(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable exception)
`

Appends the specified exception to the exceptions that were
suppressed in order to deliver this exception.


`


https://developer.android.com/reference/java/lang/Throwable` `
https://developer.android.com/reference/java/lang/Throwable#fillInStackTrace()()
`

Fills in the execution stack trace.


`


https://developer.android.com/reference/java/lang/Throwable` `
https://developer.android.com/reference/java/lang/Throwable#getCause()()
`

Returns the cause of this throwable or `null` if the
cause is nonexistent or unknown.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Throwable#getLocalizedMessage()()
`

Creates a localized description of this throwable.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Throwable#getMessage()()
`

Returns the detail message string of this throwable.


`


https://developer.android.com/reference/java/lang/StackTraceElement` `
https://developer.android.com/reference/java/lang/Throwable#getStackTrace()()
`

Provides programmatic access to the stack trace information printed by
`https://developer.android.com/reference/java/lang/Throwable#printStackTrace()`.


`


final

https://developer.android.com/reference/java/lang/Throwable` `
https://developer.android.com/reference/java/lang/Throwable#getSuppressed()()
`

Returns an array containing all of the exceptions that were
suppressed, typically by the `try`-with-resources
statement, in order to deliver this exception.


`


https://developer.android.com/reference/java/lang/Throwable` `
https://developer.android.com/reference/java/lang/Throwable#initCause(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable cause)
`

Initializes the *cause* of this throwable to the specified value.


`


void` `
https://developer.android.com/reference/java/lang/Throwable#printStackTrace()()
`

Prints this throwable and its backtrace to the
standard error stream.


`


void` `
https://developer.android.com/reference/java/lang/Throwable#printStackTrace(java.io.PrintWriter)(https://developer.android.com/reference/java/io/PrintWriter s)
`

Prints this throwable and its backtrace to the specified
print writer.


`


void` `
https://developer.android.com/reference/java/lang/Throwable#printStackTrace(java.io.PrintStream)(https://developer.android.com/reference/java/io/PrintStream s)
`

Prints this throwable and its backtrace to the specified print stream.


`


void` `
https://developer.android.com/reference/java/lang/Throwable#setStackTrace(java.lang.StackTraceElement[])(https://developer.android.com/reference/java/lang/StackTraceElement stackTrace)
`

Sets the stack trace elements that will be returned by
`https://developer.android.com/reference/java/lang/Throwable#getStackTrace()` and printed by `https://developer.android.com/reference/java/lang/Throwable#printStackTrace()`
and related methods.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Throwable#toString()()
`

Returns a short description of this throwable.


From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


From interface `

https://developer.android.com/reference/android/os/Parcelable

` `
abstract


int` `
https://developer.android.com/reference/android/os/Parcelable#describeContents()()
`

Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.


`
abstract


void` `
https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags)
`

Flatten this object in to a Parcel.


## Constants

### ERROR_APP_UNKNOWN_ERROR

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_APP_UNKNOWN_ERROR
```

An unknown error occurred while processing the call in the AppFunctionService.

This error is thrown when the service is connected in the remote application but an
unexpected error is thrown from the bound application.

This error is in the `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_APP` category.

<br />

Constant Value:

3000
(0x00000bb8)


### ERROR_CANCELLED

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_CANCELLED
```

The operation was cancelled. Use this error code to report that a cancellation is done after
receiving a cancellation signal.

This error is in the `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_SYSTEM` category.

<br />

Constant Value:

2001
(0x000007d1)


### ERROR_CATEGORY_APP

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_CATEGORY_APP
```

The error is caused by the app providing the function.

For example, the app crashed when the system is executing the request.

Errors in the category fall in the range 3000-3999 inclusive.

<br />

Constant Value:

3
(0x00000003)


### ERROR_CATEGORY_REQUEST_ERROR

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_CATEGORY_REQUEST_ERROR
```

The error is caused by the app requesting a function execution.

For example, the caller provided invalid parameters in the execution request e.g. an
invalid function ID.

Errors in the category fall in the range 1000-1999 inclusive.

<br />

Constant Value:

1
(0x00000001)


### ERROR_CATEGORY_SYSTEM

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_CATEGORY_SYSTEM
```

The error is caused by an issue in the system.

For example, the AppFunctionService implementation is not found by the system.

Errors in the category fall in the range 2000-2999 inclusive.

<br />

Constant Value:

2
(0x00000002)


### ERROR_CATEGORY_UNKNOWN

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_CATEGORY_UNKNOWN
```

The error category is unknown.

This is the default value for `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#getErrorCategory()`.

<br />

Constant Value:

0
(0x00000000)


### ERROR_DENIED

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_DENIED
```

The caller does not have the permission to execute an app function.

This error is returned to the caller of `https://developer.android.com/reference/android/app/appfunctions/AppFunctionManager#executeAppFunction(android.app.AppInteractionSession,%20android.app.appfunctions.ExecuteAppFunctionRequest,%20java.util.concurrent.Executor,%20android.os.CancellationSignal,%20android.os.OutcomeReceiver<android.app.appfunctions.ExecuteAppFunctionResponse,android.app.appfunctions.AppFunctionException>)` if
the caller does not have the necessary permission.

This error is in the `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_REQUEST_ERROR` category.

<br />

Constant Value:

1000
(0x000003e8)


### ERROR_DISABLED

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_DISABLED
```

The caller tried to execute a disabled app function.

This error is returned to the caller of `https://developer.android.com/reference/android/app/appfunctions/AppFunctionManager#executeAppFunction(android.app.AppInteractionSession,%20android.app.appfunctions.ExecuteAppFunctionRequest,%20java.util.concurrent.Executor,%20android.os.CancellationSignal,%20android.os.OutcomeReceiver<android.app.appfunctions.ExecuteAppFunctionResponse,android.app.appfunctions.AppFunctionException>)` if
the app function is considered disabled according to `https://developer.android.com/reference/android/app/appfunctions/AppFunctionState#isEnabled()`.

This error is in the `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_REQUEST_ERROR` category.

<br />

Constant Value:

1002
(0x000003ea)


### ERROR_ENTERPRISE_POLICY_DISALLOWED

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_ENTERPRISE_POLICY_DISALLOWED
```

The operation was disallowed by enterprise policy.

This error is in the `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_SYSTEM` category.

<br />

Constant Value:

2002
(0x000007d2)


### ERROR_FUNCTION_NOT_FOUND

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_FUNCTION_NOT_FOUND
```

The caller tried to execute a function that does not exist.

This error is returned to the caller of `https://developer.android.com/reference/android/app/appfunctions/AppFunctionManager#executeAppFunction(android.app.AppInteractionSession,%20android.app.appfunctions.ExecuteAppFunctionRequest,%20java.util.concurrent.Executor,%20android.os.CancellationSignal,%20android.os.OutcomeReceiver<android.app.appfunctions.ExecuteAppFunctionResponse,android.app.appfunctions.AppFunctionException>)` if
one of the following is true:

- The function identifier specified in `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest#getFunctionIdentifier()` does not match any function identifiers in the metadata returned by `https://developer.android.com/reference/android/app/appfunctions/AppFunctionManager#searchAppFunctions(android.app.appfunctions.AppFunctionSearchSpec,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<java.util.List<android.app.appfunctions.AppFunctionMetadata>,java.lang.Exception>)`.
- The app function is `https://developer.android.com/reference/android/app/appfunctions/AppFunctionMetadata#SCOPE_ACTIVITY` and `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest#getActivityId()` is not provided or does not match any activity identifiers returned by `https://developer.android.com/reference/android/app/appfunctions/AppFunctionState#getActivityIds()`, this error will be returned.
- The app function is `https://developer.android.com/reference/android/app/appfunctions/AppFunctionMetadata#SCOPE_GLOBAL` and `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest#getActivityId()` is non-null.

This error is in the `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_REQUEST_ERROR` category.

<br />

Constant Value:

1003
(0x000003eb)


### ERROR_INVALID_ARGUMENT

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_INVALID_ARGUMENT
```

The caller supplied invalid arguments to the execution request.

This error may be considered similar to `https://developer.android.com/reference/java/lang/IllegalArgumentException`.

This error is in the `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_REQUEST_ERROR` category.

<br />

Constant Value:

1001
(0x000003e9)


### ERROR_SYSTEM_ERROR

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_SYSTEM_ERROR
```

An internal unexpected error coming from the system.

This error is in the `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_SYSTEM` category.

<br />

Constant Value:

2000
(0x000007d0)


## Fields

### CREATOR

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<AppFunctionException> CREATOR
```

<br />

<br />

## Public constructors

### AppFunctionException

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public AppFunctionException (int errorCode, 
                String errorMessage)
```

<br />

<br />

| Parameters ||
|---|---|
| `errorCode` | `int`: The error code. Value is one of the following: - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_DENIED` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_APP_UNKNOWN_ERROR` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_FUNCTION_NOT_FOUND` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_SYSTEM_ERROR` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_INVALID_ARGUMENT` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_DISABLED` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CANCELLED` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_ENTERPRISE_POLICY_DISALLOWED` |
| `errorMessage` | `String`: The error message. This value may be `null`. <br /> |

### AppFunctionException

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public AppFunctionException (int errorCode, 
                String errorMessage, 
                Bundle extras)
```

<br />

<br />

| Parameters ||
|---|---|
| `errorCode` | `int`: The error code. Value is one of the following: - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_DENIED` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_APP_UNKNOWN_ERROR` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_FUNCTION_NOT_FOUND` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_SYSTEM_ERROR` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_INVALID_ARGUMENT` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_DISABLED` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CANCELLED` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_ENTERPRISE_POLICY_DISALLOWED` |
| `errorMessage` | `String`: The error message. This value may be `null`. <br /> |
| `extras` | `Bundle`: The extras associated with this error. This value cannot be `null`. <br /> |

## Public methods

### describeContents

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`,
the return value of this method must include the
`https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getErrorCategory

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getErrorCategory ()
```

Returns the error category.

This method categorizes errors based on their underlying cause, allowing developers to
implement targeted error handling and provide more informative error messages to users. It
maps ranges of error codes to specific error categories.

This method returns `ERROR_CATEGORY_UNKNOWN` if the error code does not belong to
any error category.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_UNKNOWN` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_REQUEST_ERROR` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_APP` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CATEGORY_SYSTEM` |

### getErrorCode

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getErrorCode ()
```

Returns one of the `ERROR` constants.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_DENIED` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_APP_UNKNOWN_ERROR` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_FUNCTION_NOT_FOUND` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_SYSTEM_ERROR` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_INVALID_ARGUMENT` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_DISABLED` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_CANCELLED` - `https://developer.android.com/reference/android/app/appfunctions/AppFunctionException#ERROR_ENTERPRISE_POLICY_DISALLOWED` |

### getErrorMessage

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getErrorMessage ()
```

Returns the error message.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value may be `null`. <br /> |

### getExtras

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Bundle getExtras ()
```

Returns any extras associated with this error.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Bundle` | This value cannot be `null`. <br /> |

### getMessage

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getMessage ()
```

Returns the detail message string of this throwable.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |

### writeToParcel

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |