Skip to main content

bn.onError

onError: (cb: AppErrorCallback) => void

description 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.

example

const handler = (error: string) => {}bn.onError(handler)

Type declaration

▸ (cb): void

Parameters

NameType
cbAppErrorCallback

Returns

void


AppErrorCallback#

Ƭ AppErrorCallback: (error: string) => void

Type declaration

▸ (error): void

Parameters

NameType
errorstring

Returns

void