All Products
Search
Document Center

Mobile Platform as a Service:my.offError

Last Updated:Jan 12, 2024

Description

my.offError

Remove the listener function for the mini program error event.

Input parameter

Function listener

The callback function for mini program error to be removed.

Sample code

my.offError(Function listener)

Page({
 onLoad() {
 my.onError(this.errorHandler);
 },
 errorHandler(res) {
 console.log('onError error', res.error);
 console.log('onError stack', res.stack);
 },
 onUnload() {
 my.offError(this.errorHandler)
 }
})