Re: File API exception codes

On Mon, Sep 6, 2010 at 12:27 PM, Ian Hickson <ian@hixie.ch> wrote:
> 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?

I'd be happy to use DOMException in FileWriter and FileSystem if Arun
switched his API over.

> Same question for the File System and File Writer APIs.
>
> 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;
>  };
>
> --
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
>

Received on Wednesday, 8 September 2010 01:00:28 UTC