Re: [IndexedDB] Exception inconsistency

2012-06-29 Thread Jonas Sicking
On Wed, Jun 13, 2012 at 7:50 PM, Kyle Huey  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



[IndexedDB] Exception inconsistency

2012-06-13 Thread Kyle Huey
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?

- Kyle