> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# onReceivedError

APISummary
收到错误时调用。

## 语法

### Android

```java
public void onReceivedError(LynxError error);
```

#### 参数

- `error`: 错误的类型和信息。

### Harmony

```typescript
public onReceivedError(error: LynxError): void;
```

#### 参数

- `error`: 错误的类型和信息。

### Desktop (C++)

```cpp
class YourViewClient : public lynx::pub::LynxViewClient {
 public:
  void OnReceivedError(int error_code, const char* message) override;
};
```

#### 参数说明

- `error_code`: 错误码。
- `message`: 错误信息。

## 兼容性

**Compatibility Table**

**Query:** `lynx-native-api.lynx-view-client.on-received-error`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-native-api/lynx-view-client/on-received-error.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| on-received-error | Yes (1.0) | Yes (3.4) | Unknown | Yes (3.7) | Yes (3.7) | No |

**`on-received-error`**

Called when error received.

**Specifications:**

