
# OnError
**回调方法描述**
SDK项上层推送错误通知。
**回调方法定义**
```
/* 错误通知推送 */   
void OnError(ShareAppErr errorCode, std::string errorMsg, void* extralInfo) {}
```
**参数描述**
| 参数         | 是否必须 | 类型                                                                                              | 描述     |
|:---|:---|:---|:---|
| errorCode  | 是    | [4.6.5.1.7](https://support.huaweicloud.com/ideahub-IdeaShare-SDK/win-sdk-0067.html)ShareAppErr | 错误枚举值  |
| errorMsg   | 是    | std::string                                                                                     | 错误描述   |
| extralInfo | 是    | void\*                                                                                          | 其他附加信息 |
   
**示例代码**
```
void ShareEventHandler::OnError(ShareAppErr errorCode, std::string errorMsg, void* extralInfo)   
{    
  // 错误上报给UI   
}
```
