Re: File API exception codes

----- Original Message -----
> On Mon, 6 Sep 2010, Nathan wrote:
> >
> > Just noticed that File API specifies NOT_READABLE_ERR as code 24,
> > whereas 24 is already used for DATA_CLONE_ERR
> > http://dev.w3.org/html5/spec/common-dom-interfaces.html#data_clone_err
> >
> > Not sure if this is an issue or not, but a heads up regardless.
> 
> I've updated HTML5 to use 25 for DATA_CLONE_ERR. We're keeping an
> informal
> registry of codes here:
> 
> http://wiki.whatwg.org/wiki/Exception_Codes
> 
> I've added NOT_READABLE_ERR and ENCODING_ERR to the wiki.
> 
> Why does File API use FileError/FileException and not DOMException? If
> it
> doesn't use DOMException, these don't actually clash, and it seems
> weird
> that we would use the same numbers. Can this be fixed?


It *does* seems sensible to use DOMException instead of FileException in the synchronous case (on WebWorkers).  But in the asynchronous case, DOMError seems a bit janky (http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-Interfaces-DOMError).  So the DOMError exposes a DOMObject that is the affiliated relatedException?  That seems a bit harder than a mere FileError, but I'm willing to go with DOMError here as well.

I find what HTML5 does for adding exception codes pretty attractive.  And reusing DOMException and DOMError would alleviate the naming issue (BlobException/BlobError vs. FileException/FileError).  I'm just concerned that DOMError seems awkward -- is anyone working on it?

> 
> To add exception codes, just do something like what HTML5 does:
> 
> [Supplemental] exception DOMException {
> const unsigned short URL_MISMATCH_ERR = 21;
> const unsigned short QUOTA_EXCEEDED_ERR = 22;
> const unsigned short DATA_CLONE_ERR = 25;
> };
> 

Received on Wednesday, 8 September 2010 01:29:40 UTC