W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2015

Re: [IndexedDB] When is an error event dispatched at a transcation?

From: Glen Huang <curvedmark@gmail.com>
Date: Fri, 6 Feb 2015 08:57:16 +0800
Cc: Webapps WG <public-webapps@w3.org>
Message-Id: <697D6BF6-72B1-4F49-BD63-E2192469D312@gmail.com>
To: Joshua Bell <jsbell@google.com>
Darn it, I forgot they bubble. Thank you for the detailed explanation.

> On Feb 6, 2015, at 1:59 AM, Joshua Bell <jsbell@google.com> wrote:
> On Thu, Feb 5, 2015 at 12:58 PM, Glen Huang <curvedmark@gmail.com <mailto:curvedmark@gmail.com>> wrote:
> The IDBTransaction interface exposes an onerror event handler. I wonder when that handler gets called? The algorithm of "Steps for aborting a transaction” dispatches error events at requests of the transaction, but never at the transaction itself, only an abort event is dispatched, if I understand the spec correctly.
> If that is true, why exposing the onerror event handler on the IDBTransaction interface?
> In the steps 3.3.12 Fire an error event, "The event bubbles and is cancelable. The propagation path for the event is the transaction's connection, then transaction and finally request." Which is to say: if cancelBubble() is not called, the event will bubble from the request to the transaction to the connection.
> A common use case is to attach an error handler on the transaction or database connection to e.g. log errors back to the server, rather than having to attach such a handler to every request.

Received on Friday, 6 February 2015 01:07:25 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:43 UTC