Describe the bug
使用小程序实时调试;控制台日志不能正常显示对应错误;而是显示[PageSpy] An unknown error occurred and no message or stack trace available;
原因是因为
public errorHandler(error: { message: string; stack: string }) {
if (!ErrorPlugin.hasInitd) {
return;
}
if (error.stack || error.message) {
/* c8 ignore start */
const { message, stack } = error;
this.sendMessage(stack || message, formatErrorObj(error));
/* c8 ignore stop */
} else {
// When the error does not exist, use default information
const defaultMessage =
'[PageSpy] An unknown error occurred and no message or stack trace available';
this.sendMessage(defaultMessage, null);
}
}
在小程序里面,onerror的回调函数参数只有message;没有error.stack || error.message
Steps to reproduce
No response
System Info
Logs
No response
Validations
Describe the bug
使用小程序实时调试;控制台日志不能正常显示对应错误;而是显示[PageSpy] An unknown error occurred and no message or stack trace available;
原因是因为
在小程序里面,onerror的回调函数参数只有message;没有error.stack || error.message
Steps to reproduce
No response
System Info
Logs
No response
Validations