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

[indexeddb] Exception type for NON_TRANSIENT_ERR code

From: Israel Hilerio <israelh@microsoft.com>
Date: Mon, 3 Oct 2011 23:21:10 +0000
To: "Jonas Sicking (jonas@sicking.cc)" <jonas@sicking.cc>
CC: "public-webapps@w3.org" <public-webapps@w3.org>
Message-ID: <F695AF7AA77CC745A271AD0F61BBC61E3F4C022B@TK5EX14MBXC117.redmond.corp.microsoft.com>
On Thursday, September 29, 2011 12:04 AM, Jonas Sicking wrote:
> For several of these I think we can reuse existing DOMExceptions.
> Here's how I'd map the exceptions which are currently in the IndexedDB
> spec:
> 
> UNKNOWN_ERR
> Mint a new UnknownError. Alternatively we could simply throw an
> ECMAScript Error object with no more specific type.
> 
> NON_TRANSIENT_ERR
> 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.  This will also allow us to assign a code value of 0 and a message: "This error occurred because an operation was not allowed on an object. A retry of the same operation would fail unless the cause of the error is corrected."

What do you think?

Israel
Received on Monday, 3 October 2011 23:21:54 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:48 GMT