# A2uiClientErrorMessage

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/A2uiClientToServerMessage.kt+class:androidx.a2ui.model.protocol.A2uiClientErrorMessage) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

*** ** * ** ***


```
public final class A2uiClientErrorMessage implements A2uiClientToServerMessage
```

<br />

*** ** * ** ***

Represents a client-side execution or validation error reported to the server.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientErrorMessage#A2uiClientErrorMessage(kotlin.String,kotlin.String,kotlin.String,kotlin.collections.Map)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html code, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html surfaceId, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html message, @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> context )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientErrorMessage#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/A2uiClientErrorMessage#getCode()()` An error category identifier (such as "VALIDATION_FAILED" or "RUNTIME_ERROR"). |
| `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/A2uiClientErrorMessage#getContext()()` A map containing custom properties and error context (such as the target path). |
| `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/A2uiClientErrorMessage#getMessage()()` A human-readable description of the error. |
| `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/A2uiClientErrorMessage#getSurfaceId()()` The unique ID of the surface where the error occurred. |
| `int` | `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiClientErrorMessage#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/A2uiClientErrorMessage#toString()()` |

## Public constructors

### A2uiClientErrorMessage

```
public A2uiClientErrorMessage(
    @NonNull String code,
    @NonNull String surfaceId,
    @NonNull String message,
    @NonNull Map<@NonNull String, Object> context
)
```

## 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").

### 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). For validation errors ("VALIDATION_FAILED"), this map must contain exactly the "path" key (whose value must be a non-null String) and absolutely nothing else. For other errors, it is open-ended.

### getMessage

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

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

A human-readable description of the error.

### getSurfaceId

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

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

The unique ID of the surface where the error occurred.

### hashCode

```
public int hashCode()
```

### toString

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