From f3becfea3ad707abbae39fb6b38b019b8956757a Mon Sep 17 00:00:00 2001 From: Andy Gup Date: Mon, 11 May 2015 15:28:14 -0600 Subject: [PATCH] Correctly catch put failure --- lib/edit/attachmentsStore.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/edit/attachmentsStore.js b/lib/edit/attachmentsStore.js index 0e99a07..a305743 100644 --- a/lib/edit/attachmentsStore.js +++ b/lib/edit/attachmentsStore.js @@ -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);