W3C home > Mailing lists > Public > public-pointer-events@w3.org > January to March 2014

RE: Exception usage

From: Jacob Rossi <Jacob.Rossi@microsoft.com>
Date: Wed, 12 Feb 2014 23:57:53 +0000
To: Anne van Kesteren <annevk@annevk.nl>, "Olli@pettay.fi" <olli@pettay.fi>
CC: Matt Brubeck <mbrubeck@mozilla.com>, "public-pointer-events@w3.org" <public-pointer-events@w3.org>
Message-ID: <ddcc42b4e20e48e4bd38cdbeeaf06902@BY2PR03MB457.namprd03.prod.outlook.com>
On Wed, Feb 12, 2014 at 2:46 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
>
> On Wed, Feb 12, 2014 at 1:20 AM, Olli Pettay <Olli.Pettay@helsinki.fi> wrote:
> > http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.normalize

> > is still quite different.
> > There you have a predefined set of values, and if something else is passed,
> > it is RangeError.
> >
> > pointerId can be any random number. RangeError gives a wrong hint that there
> > would be some sort of
> > continuous range, and that is explicitly what we don't want.
>
> Fair enough. Then TypeError would be fine.

I think TypeError is also inappropriate. The exceptional scenario includes cases where the argument type is correct (number) but the particular value is not.

In general, using ES error types when appropriate makes a lot of sense. But in this case, I don't see an existing ES error that fits. All of the close options would likely cause developer confusion (e.g. pointer Ids have some bounded range or that the methods take something other than a number) as described by Olli and Matt.

> (Can code always know the active pointers btw?)

With a fairly simply state machine, yes. Pointers become active when pointerdown fires and become inactive when pointerup or pointercancel fire.  In the future, we might explore exposing a list of active pointers (but it's not a priority for our group at the moment).


Received on Wednesday, 12 February 2014 23:58:24 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:20:26 UTC