Bug 16454 - SomethingError
SomethingError
Status: RESOLVED FIXED
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL
unspecified
PC All
: P2 normal
: ---
Assigned To: Cameron McCormack
public-webapps-bugzilla
http://dev.w3.org/2006/webapi/WebIDL/...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-20 18:25 UTC by Marcos Caceres
Modified: 2012-03-21 23:00 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos Caceres 2012-03-20 18:25:41 UTC
The spec says "When an algorithm says to “throw a SomethingError” then this means to construct a new ECMAScript SomethingError object and to throw it, just as the algorithms in ECMA-262 do."

But you only ever throw a TypeError (or I could not find any other type of error?). I think it would be better to have all throw TypeError just link directly to ECMAScript5.
Comment 1 Anne 2012-03-20 20:16:21 UTC
Indexed DB does that. What is wrong with having a convenience hook?
Comment 2 Marcos Caceres 2012-03-20 20:26:18 UTC
(In reply to comment #1)
> Indexed DB does that. What is wrong with having a convenience hook?

Nothing wrong, if it does something. If in this case it doesn't do anything, then it is redundant. I would rather click on "throw an TypeError" and be taken straight to ECMAScript5 (rather than do a roundtrip). http://es5.github.com/#x15.11.6.5
Comment 3 Cameron McCormack 2012-03-21 23:00:50 UTC
Yeah, sorry it would be good to have a link to the actual ECMAScript requirements.  I've added a link from #dfn-throw to #es-throwing-exceptions.