This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The most basic question is, what should happen in the following scenario: objectStore.add("value", 1); // succeeds req = objectStore.add("value", 1); // will fail due to key collision req.onerror = function(e) { throw; } This should obviously abort the transaction, but should transaction.error.name return "ConstraintError" or "AbortError". I don't have a strong opinion. It sort of feels like the exception does override normal behavior, so we should set it to "AbortError".
A slightly less ambiguous case is objectStore.add("value", 1); // succeeds req = objectStore.add("value", 1); // will fail due to key collision req.onerror = function(e) { e.preventDefault(); throw; } Here it seems more clear that setting transaction.error to a "AbortError" is the right thing to do.
One way to look at it is that for a normal function call, an exception overrides any return values.
If I was writing a test for that, I'd check for AbortError. So guess I vote for that. (The exception inside a handler has consequences stuff always felt a bit weird, tho ;-) )
http://dvcs.w3.org/hg/IndexedDB/rev/aab14b0951ca