I'm trying to create a costume Error handler. So far I'm able to retrieve the errors triggered by the system with the following code:
window.onerror = function(message, source, lineno, colno, error) {
me.errorHandler(error, true);
return true;
};
My problem is: I would love to specify what kind of event or action triggered my error.
Is there any way to find out what Events/Listeners/Actions were triggered? Something like using Ext.util.Observable
I've found my solution. Its something like this;
//object is the main Page/Menu that i want to "Observate"
Ext.util.Observable.capture(object, function(){
//arguments have the listener, page and component
doStuff(arguments)
});
Doing this, every time an event is fired on the "object" this function will be triggered, and i can log the error or the event fired.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.