         onError()
         return
 
-      txn = db.transaction ['docs', doc.slug], 'readwrite'
+      txn = @idbTransaction db, stores: ['docs', doc.slug], mode: 'readwrite', ignoreError: false
       txn.oncomplete = =>
         delete @cachedDocs?[doc.slug]
-        if txn.error then onError() else onSuccess()
+        onSuccess()
+        return
+      txn.onerror = (event) ->
+        event.preventDefault()
+        onError(event)
         return
 
       store = txn.objectStore(doc.slug)

    try
      db = event.target.result
      unless @checkedBuggyIDB
        db.transaction(['docs', app.docs.all()[0].slug], 'readwrite').abort() # https://bugs.webkit.org/show_bug.cgi?id=136937
        @checkedBuggyIDB = true
    catch
      try db.close()

        onError()
        return

      txn = @idbTransaction db, stores: [entry.doc.slug], mode: 'readonly'
      store = txn.objectStore(entry.doc.slug)

      req = store.get(entry.dbPath())
