mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
fortify _makeEditRequest
This commit is contained in:
parent
1204ddfa1f
commit
84ff80d8f7
@ -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);
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user