fortify _makeEditRequest

This commit is contained in:
Andy Gup 2015-07-29 18:21:13 -06:00
parent 1204ddfa1f
commit 84ff80d8f7

View File

@ -2120,15 +2120,25 @@ define([
{
if( req.status === 200 && req.responseText !== "")
{
var obj = JSON.parse(this.response);
callback(obj.addResults, obj.updateResults, obj.deleteResults);
try {
var obj = JSON.parse(this.response);
callback(obj.addResults, obj.updateResults, obj.deleteResults);
}
catch(err) {
errback("Unable to parse xhr response");
}
}
};
req.onerror = function(e)
{
console.log("_makeEditRequest failed: " + e);
errback(e);
};
req.ontimeout = function() {
errback("xhr timeout error");
};
req.timeout = 15000;
req.send(params);
},