Dhtmlx.ajax - catching error

In using dhtmlx.ajax - how do you capture an error on the return?
Thanks
Jerry

You may check status of the XMLHttpRequest object:

dhtmlxAjax.post(url,params,response);

function response(loader){
var status = loader.xmlDoc.status;

}