# A2uiException

Artifact: [androidx.a2ui:a2ui-model](https://developer.android.com/jetpack/androidx/releases/a2ui) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/model/protocol/A2uiException.kt+class:androidx.a2ui.model.protocol.A2uiException) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

*** ** * ** ***


```
public sealed class A2uiException 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.a2ui.model.protocol.A2uiException](https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException) |

Known direct subclasses [A2uiException.A2uiRuntimeException](https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException.A2uiRuntimeException), [A2uiException.A2uiValidationException](https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException.A2uiValidationException)

|---|---|
| `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException.A2uiRuntimeException` | Thrown for any client-side runtime or execution failures (such as dynamic binding or function evaluation failures) that should be reported to the agent and are not structural validation errors |
| `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException.A2uiValidationException` | Thrown when an incoming JSON payload from the server structurally violates its defined `A2uiSchema`. |

*** ** * ** ***

Base class for all A2UI protocol and execution errors.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException.A2uiRuntimeException extends https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException` Thrown for any client-side runtime or execution failures (such as dynamic binding or function evaluation failures) that should be reported to the agent and are not structural validation errors |
| `public final class https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException.A2uiValidationException extends https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException` Thrown when an incoming JSON payload from the server structurally violates its defined `A2uiSchema`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException#getCode()()` An error category identifier (such as "VALIDATION_FAILED" or "RUNTIME_ERROR") that is automatically assigned by the exception subclass. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/Object.html>` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException#getContext()()` A map containing custom properties and error context (such as the target path). |
| `int` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiException#toString()()` |

### 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

### equals

```
public boolean equals(Object other)
```

### getCode

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

```
public final @NonNull String getCode()
```

An error category identifier (such as "VALIDATION_FAILED" or "RUNTIME_ERROR") that is automatically assigned by the exception subclass. This identifier is reported back to the server in the error payload, allowing the remote agent to recognize and handle the specific category of failure.

### getContext

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

```
public final @NonNull Map<@NonNull String, Object> getContext()
```

A map containing custom properties and error context (such as the target path).

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```