基础 /小程序 /应用级事件 /wx.onError /
wx.onError(function listener)
基础库 2.1.2 开始支持,低版本需做兼容处理。
小程序插件:不支持
微信 Windows 版:支持
微信 Mac 版:支持
微信 鸿蒙 OS 版:支持
功能描述
监听小程序错误事件。如脚本错误或 API 调用报错等。该事件与 App.onError
的回调时机与参数一致。
参数
function listener
小程序错误事件的监听函数
参数
object error
错误
属性 | 类型 | 说明 |
message | string | 错误信息,包含堆栈 |
The translations are provided by WeChat Translation and are for reference only. In case of any inconsistency and discrepancy between the Chinese version and the English version, the Chinese version shall prevail.Incorrect translation. Tap to report.