error handling in grid to avoid load xml errors

Hi,

I am getting load xml errors frequently.

How can i get rid of these errors?

When there is no correct data coming from DB i am getting this errors.How to catch that exception so that load xml pop up will not come?

You can catch error and prevent error message by using default error handling routine.

function myErrorHandler(type, desc, erData){
    //custom code can be placed here
    return false;
}
dhtmlxError.catchError(“LoadXML”, myErrorHandler);

The array contains additonal data related to error
    erData=[xmlHttpRequest , object]

First element - xmlHttpRequest object, which contain all data requested from server.
Second element - dhtmlx object, component which throw error while loading.

You can get any additional error info by checking xmlHttpRequest properties (xmlHttpRequest.responseText for example )


I am getting loadXML error and i found the answer for this to use like this



function myErrorHandler(type, desc, erData){
    //custom code can be placed here
    return false;
}
dhtmlxError.catchError(“LoadXML”, myErrorHandler);



 



I am having some doughts on the above code .



what are the parameters i have to give for myerrorhandler.I mean what is the value i have to give for “type” and “desc”.And u said



erData array.I didnt understand what value we have to give for the “object” parameter.can u give any sample code for this along with custom code to be placed in myerrorHandler.

you must not specify any parameters, they are sent to custom error handler by component code
In simplest case , if you need just block error message, the next will be enough

    dhtmlxError.catchError(“LoadXML”, function(){ return false; });


Thanx for ur update.



Where i can place this code line  “dhtmlxError.catchError(“LoadXML”, function(){ return false; });”



After mygrid.LoadXML("");  or before mygrid.LoadXML("");  ??


It doesn’t really matter, placing before loadXML is more safe approach, but it will work in any case.