mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
Correctly catch put failure
This commit is contained in:
parent
e8360a181d
commit
f3becfea3a
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user