Creating your own errors

Mark S. Miller erights at google.com
Tue Aug 6 12:16:17 PDT 2013


Is a DomainError the dual of a RangeError?


On Tue, Aug 6, 2013 at 11:51 AM, Brendan Eich <brendan at mozilla.com> wrote:

> Problem is, "TypeError" for what Python calls "ValueError", what JS might
> call "DomainError" to go with "RangeError", is lame. Allen, Rick, I forget:
> have we discussed DomainError or ValueError?
>
> /be
>
>
> Anne van Kesteren wrote:
>
>> On Wed, Jul 17, 2013 at 7:10 PM, Jonas Sicking<jonas at sicking.cc>  wrote:
>>
>>> Good point. It's entirely plausible that we could simply use the ES
>>> SyntaxError in all cases where DOMException SyntaxError is being
>>> thrown today. Would need to be tested though.
>>>
>>
>> SyntaxError is used by JavaScript for syntax errors in JavaScript. We
>> shouldn't use it for where we throw "SyntaxError" in platform APIs
>> today per discussion with Allen. (He considered the usage for JSON
>> already as a mistake.)
>>
>>
>>


-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130806/717c08ad/attachment.html>


More information about the es-discuss mailing list