Skip to main content
Version: 3.x

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.

Reference

Type

(callback: Callback) => void

Parameters

Callback

The callback function for the Mini Program error event.

(error: string) => void
ParameterTypeDescription
errorstringError message, including stacks.

API Support

APIWeChat Mini-ProgramH5React Native
Taro.onError✔️