We would like some kind of handler to catch any unhandled errors so we can log them. On our app initialization we have code like.
var app = new Framework7({
name: 'client-app',
theme: 'auto',
el: '#app',
component: App,
id: 'io.framework7.myapp',
store: store,
routes: routes,
on: {
init: function () {
},
pageInit: function (page) {
window.onerror = function(e) {
log('Error happened' + e);
}
},
},
});
The window.onerror on the pageInit is never called when an error occurs. Is there a better way to handle this?