W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: [indexeddb] Exception type for NON_TRANSIENT_ERR code

From: Joshua Bell <jsbell@chromium.org>
Date: Mon, 3 Oct 2011 17:10:47 -0700
Message-ID: <CAD649j6n+H3-GGNtFLs-YcuN3Hpc+Z_2_A8TRAN4gotR3piGww@mail.gmail.com>
To: Israel Hilerio <israelh@microsoft.com>
Cc: "Jonas Sicking (jonas@sicking.cc)" <jonas@sicking.cc>, "public-webapps@w3.org" <public-webapps@w3.org>
On Mon, Oct 3, 2011 at 4:21 PM, Israel Hilerio <israelh@microsoft.com>wrote:

> On Thursday, September 29, 2011 12:04 AM, Jonas Sicking wrote:
> > I think in many cases we should simply throw a TypeError here. That seems
> > to match closely to how TypeError is used by WebIDL now.
> As I'm mapping the Exception codes to the new Exception type model, I
> thought we should mint a new type for NON_TRANSIENT_ERR, NonTransientError.
>  The reason is that TypeError seems to be designed to cover all intrinsic
> conversion cases and NON_TRANSIENT_ERR seems to be dealing with additional
> validation beyond what TypeError normally checks for.

As an aside, the current draft has IDBFactory.cmp() raise a
NON_TRANSIENT_ERR when an invalid key is used, but most of the other
functions that take keys  (IDBObjectStore.add/put/get/delete(), etc) raise a
DATA_ERR on invalid keys. It would be nice to be consistent in the case
where the explicitly specified key is invalid (vs. when it is a calculated
Received on Tuesday, 4 October 2011 00:11:13 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC