W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: [IndexedDB] Exception inconsistency

From: Jonas Sicking <jonas@sicking.cc>
Date: Fri, 29 Jun 2012 15:55:34 +0200
Message-ID: <CA+c2ei8ab_GsSKzjzbw=ELKX4BdnnKuDOuLh62qCHCyye7HxMA@mail.gmail.com>
To: Kyle Huey <me@kylehuey.com>
Cc: Web Applications Working Group WG <public-webapps@w3.org>
On Wed, Jun 13, 2012 at 7:50 PM, Kyle Huey <me@kylehuey.com> wrote:
> If a keypath passed to createObjectStore fails certain constraints (not
> passing arrays or empty strings to autoIncrement) the spec says to throw an
> InvalidAccessError.
> If a keypath passed to createIndex fails constraints (an array keypath
> passed to a multientry index) the spec says to throw a NotSupportedError.
> Why are these not consistent?

Good catch.

We use InvalidAccessError everywhere else, so switching to
InvalidAccessError for index creation too seems like the easiest

It's unfortunate that both exception types exist since they basically
seem to have the same meaning. DOM Core seems to only fire
NotSupportedError, while HTML5 fires both types of errors. I didn't
check other specs.

/ Jonas
Received on Friday, 29 June 2012 13:56:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:34 UTC