Re: [IndexedDB] Exception inconsistency

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
solution.

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