W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2010

Re: [IndexedDB] Should .add/.put/.update throw when called in read-only transaction?

From: Andrei Popescu <andreip@google.com>
Date: Fri, 2 Jul 2010 16:14:13 +0100
Message-ID: <AANLkTimQiqws3JlKKTqhJwczkvgYkRgC9iz714jNsbYu@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Webapps WG <public-webapps@w3.org>
On Thu, Jul 1, 2010 at 2:17 AM, Jonas Sicking <jonas@sicking.cc> wrote:
>
> Additionally, the structured clone algorithm, which defines that an
> exception should synchronously be thrown if the object is malformed,
> for example if it consists of a cyclic graph. So .add/.put/.update can
> already throw under certain circumstances.
>

This isn't actually true for the async version of our API. The current
wording is:

"If the value being stored could not be serialized by the internal
structured cloning algorithm, then an error event is fired on this
method's returned object with its code set to SERIAL_ERR and a
suitable message."

In the sync version, if the structure cloning algorithm threw, we do
throw an IDBDatabaseException with code SERIAL_ERR.

When fixing 10064,  I'll also change the spec to throw for
serialization errors in the async case.

Andrei
Received on Friday, 2 July 2010 15:14:45 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:39 GMT