Taro.onError(callback)
Listens on the Mini Program error event. This event is triggered as a result of script error or failed API call. The callback timing and parameters of this event are consistent with those of App.onError
.
Type
(callback: Callback) => void
Parameters
Callback
The callback function for the Mini Program error event.
(error: string) => void
Parameter | Type | Description |
---|---|---|
error | string | Error message, including stacks. |
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
Taro.onError | ✔️ |