Dhtmlx onerror handler

I was looking into adding a window.onerror handler in my javascript to log errors into my database. Everything was working fine until I added an HTMLX tree. I found that the js files are overriding my declared onerror handler and using the one that is defined somewhere in the js files.

Is there a way to turn off the error handling? I feel like this error handling within dhtmlx should be using try/catch blocks and not catching all errors from the window.

So far I’ve narrowed down the possible js files to dhtmlxcommon.js and dhtmlxtree_er.js

Any help would be great!

Travis

Yes, dhtmlxtree_er.js extension can redefine window.onerror handler that you set before. So, you should not do not use this library if you have set custom event handlers.

If you want to catch XML loading error, you may use the following approach

[code]dhtmlxError.catchError(“LoadXML”,my_error_handler);
dhtmlxError.catchError(“DataStructure”,my_error_handler);

function my_error_handler(type, name, data){
/your code here/
}[/code]

docs.dhtmlx.com/doku.php?id=dhtm … r_handling

Thanks, but do I need to change the code in the dhtmlxtree_er.js? Or disable it somehow?

The only way I’ve found to get around this is to declare my window.onerror after the dhtmlxtree.js is included in my page.