indexedDb.open can log an error to console without the possibility of catching it.

RESOLVED INVALID

Status

()

Core
DOM: IndexedDB
--
minor
RESOLVED INVALID
3 years ago
3 years ago

People

(Reporter: Roman, Unassigned)

Tracking

43 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0
Build ID: 20160105164030

Steps to reproduce:

I ran this code:

var db = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB;

try {
  var req = db.open('aaaaaa');
} catch (err)
{
  console.debug("Catched.");
}

req.onsuccess = function() { console.debug("Success."); }
req.onerror = function() { console.debug("Fail."); }



Actual results:

In console log in developer tools there was QuotaExceededError error and "Fail.".


Expected results:

There shouldn't be QuotaExceededError but an exception thrown. So expected result would be "Catched.", "Fail.". without the QuotaExceededError.


-----
It also seemed that under some circumstances the onerror never gets called, but after a refresh of firefox I haven't been able to reproduce it so far.
(Reporter)

Updated

3 years ago
Summary: indexedDb.open can fail before setting up handlers without exception. → indexedDb.open can log an error to console without possibility of catching it.
(Reporter)

Updated

3 years ago
Summary: indexedDb.open can log an error to console without possibility of catching it. → indexedDb.open can log an error to console without the possibility of catching it.
(Reporter)

Updated

3 years ago
Severity: normal → minor

Updated

3 years ago
Component: Untriaged → DOM: IndexedDB
Product: Firefox → Core
IndexedDB does not synchronously throw all errors, because some error conditions require going to the hard disk asynchronously to find.  Errors that are thrown asynchronously get dispatched to the IDBRequest.onerror callback, and you can prevent them from showing up in the console by calling event.preventDefault() on them.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.