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: Jonas Sicking <jonas@sicking.cc>
Date: Fri, 2 Jul 2010 11:45:39 -0700
Message-ID: <AANLkTinwjn9Y_pHCcZilK8d_NvfL8wS4Di_9S-IL_BiA@mail.gmail.com>
To: Andrei Popescu <andreip@google.com>
Cc: Webapps WG <public-webapps@w3.org>
On Fri, Jul 2, 2010 at 8:14 AM, Andrei Popescu <andreip@google.com> wrote:
> 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.

Awesome, thanks!

/ Jonas
Received on Friday, 2 July 2010 18:46:33 GMT

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