dhtmlxerror

Hello,



im trying to figure out a way to have finer control over dhtmlx errors in such way:



1) what type of errors does dhtmlxerror give?



2) what i am looking for is to detect whether the error is an HTTP 404, or a session timeout, or an xml parsing error , etc… does the dhtmlx error component already handles that?



The goal here is to display a login popup whenever we get a session timeout from the server…or a popup alert in case of unknown errors. Any recommendations on how to achieve that?





Thanks again,



j


Hello,


Components allow to process LoadXML error. This error occurs when you try to load incorrect xml: server-side script returns incorrect xml or loaded file doesn’t exist.


So, in case of session timeout the server-side script should return a document that is not correct xml:


function my_error_handler(type, name, data){
showLoginWindow();/some your function/
}


dhtmlxError.catchError(“LoadXML”,my_error_handler);






Hi,

Thanks for the confirmation. But how can i differentitate between an actual parsing error and a session timeout?


thanks,
j


Hello,


The third parameter of the error handler is an array. Its 1st element is xml document. So, you can check the response text.


A small example for IE:


if in case of session timeout your server-side script returns document with “session timeout” text, you can do something as follows:


function my_error_handler(type, name, data){
if(data[0].responseTEXT == “session timeout”) showSessionMessage();


else showParisngMessage();
}