title: Taro.onError(callback)

sidebar_label: onError

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.

Reference

Type

  1. (callback: Callback) => void

Parameters

Callback

The callback function for the Mini Program error event.

  1. (error: string) => void
Parameter Type Description
error string Error message, including stacks.

API Support

API WeChat Mini-Program H5 React Native
Taro.onError ✔️