Correctly catch put failure

This commit is contained in:
Andy Gup 2015-05-11 15:28:14 -06:00
parent e8360a181d
commit f3becfea3a

View File

@ -69,12 +69,12 @@ O.esri.Edit.AttachmentsStore = function () {
callback(false, event.target.error.message);
};
var objectStore = transaction.objectStore(this.objectStoreName);
var request = objectStore.put(newAttachment);
request.onsuccess = function (event) {
//console.log("item added to db " + event.target.result);
};
try {
transaction.objectStore(this.objectStoreName).put(newAttachment);
}
catch(err) {
callback(false, err);
}
}
else {
callback(false, fileContent);