RE: [indexeddb] Change IDBRequest.errorCode property to match new Exception type model

On Monday, October 03, 2011 7:31 PM, Jonas Sicking wrote:
> On Mon, Oct 3, 2011 at 5:36 PM, Israel Hilerio <israelh@microsoft.com> wrote:
> > Jonas,
> >
> > We're removing error code values as part of the new exception type
> model.
> > This will impact the IDBRequest.errorCode property.  I believe we want
> > to rename this property to errorName and change its type to DOMString
> > in order to match the new Exception type model name. This change will
> > impact all the places where errorCode is used today in the spec.
> > However, it should be fairly easy to fix assuming we follow the above
> model.
> >
> > Do you agree?
> 
> We might want to do something similar to what the FileAPI spec is doing,
> and the HTML5 spec is doing for HTMLMediaElement. Both specs have a
> .error property which returns an object which contains error information. A
> nice aspect of that approach is that it enables us to add more information
> about the error later, and even have different pieces of information for
> different errors.
> 
> / Jonas

We like the approach!  We'll update the IDBRequest.errorCode property to IDBRequest.error and assign it a type of DOMError to mimic the spec changes in the File API [1].  We'll also use the same DOMError reference as you.

In addition, we'll add a new "error" property to the IDBTransaction property, per our previous email thread, to capture the request or system error that triggered the onerror and onabort handlers.

Everywhere where we currently use an errorCode like "section 4.4 Steps for aborting a transaction" step 2.1, we'll change the text from:

1. Set the done flag on the request to true, set result of the request to undefined and set errorCode of the request to ABORT_ERR.

To something equivalent but using DOMError:

1. Set the done flag on the request to true, set result of the request to undefined and set the error attribute to a new DOMError object with a name attribute of AbortError.

Is this what you had in mind?

Israel
[1] http://dev.w3.org/2006/webapi/FileAPI/

Received on Friday, 7 October 2011 22:07:42 UTC