<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23367</bug_id>
          
          <creation_ts>2013-09-26 13:47:41 +0000</creation_ts>
          <short_desc>Move exceptions into IDL</short_desc>
          <delta_ts>2014-10-04 02:32:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>25896</dependson>
          <blocked>23346</blocked>
    
    <blocked>24028</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne">annevk</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>dom</cc>
    
    <cc>erik.arvidsson</cc>
    
    <cc>harald</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
    
    <cc>travil</cc>
    
    <cc>w3c</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>93879</commentid>
    <comment_count>0</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-26 13:47:41 +0000</bug_when>
    <thetext>DOMException should move into IDL. We should decide whether to harmonize with JavaScript. I can see either having lots of subclasses, which seems like even more pollution, or accepting the platform is a bit different here.

DOMError will be removed from the DOM. Returning DOMException from an object is fine.

(I thought there was a bug on this, but I could not find it.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97322</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-12-09 14:26:45 +0000</bug_when>
    <thetext>*** Bug 24000 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99643</commentid>
    <comment_count>2</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2014-02-03 22:24:52 +0000</bug_when>
    <thetext>Seems like we should expose it in all globals, too; we have worker APIs that throw DOMExceptions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109462</commentid>
    <comment_count>3</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2014-07-29 06:03:43 +0000</bug_when>
    <thetext>Is the plan to have DOMException subclass Error? Seems like a good idea, any known web-compat issues you can think of?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109463</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-29 06:13:10 +0000</bug_when>
    <thetext>I thought that was already the case by it using &quot;exception&quot; rather than &quot;interface&quot;. But yes, and no.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109509</commentid>
    <comment_count>5</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2014-07-29 17:21:53 +0000</bug_when>
    <thetext>(In reply to Travis Leithead [MSFT] from comment #3)
&gt; Is the plan to have DOMException subclass Error? Seems like a good idea, any
&gt; known web-compat issues you can think of?

FWIW, Blink and WebKit both have Error.prototype on the prototype chain of DOMExceptions. This change was done maybe 2 years ago.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109510</commentid>
    <comment_count>6</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-07-29 18:07:44 +0000</bug_when>
    <thetext>So will Gecko, as of Firefox 32.  That&apos;s not the same as an actual ES6 subclass, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109511</commentid>
    <comment_count>7</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2014-07-29 18:15:28 +0000</bug_when>
    <thetext>(In reply to Boris Zbarsky from comment #6)
&gt; So will Gecko, as of Firefox 32.  That&apos;s not the same as an actual ES6
&gt; subclass, though.

That is true. We should probably make `DOMException.[[Prototype]] === Error` as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112622</commentid>
    <comment_count>8</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2014-10-03 05:34:37 +0000</bug_when>
    <thetext>I&apos;ve removed IDL exception definitions, moved DOMException into the spec (including the table of names and legacy codes), and added types to refer to them -- Error for any exception type (including the native ECMAScript Error objects) and DOMException for just DOMExceptions.  I also made DOMException.[[Prototype]] == Error.prototype.

https://github.com/heycam/webidl/commit/50e172ec079db073c3724c9beac1b576fb5dbc47

http://heycam.github.io/webidl/#idl-exceptions
http://heycam.github.io/webidl/#idl-Error
http://heycam.github.io/webidl/#idl-DOMException
http://heycam.github.io/webidl/#es-Error
http://heycam.github.io/webidl/#es-DOMException
http://heycam.github.io/webidl/#es-exceptions
http://heycam.github.io/webidl/#es-exception-objects
http://heycam.github.io/webidl/#es-creating-throwing-exceptions</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112630</commentid>
    <comment_count>9</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-10-03 08:37:50 +0000</bug_when>
    <thetext>Excellent, glad to be rid of this:

https://github.com/whatwg/dom/commit/7fe5736d3ed2717d71a3d2627b07dee97e10ef05</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112672</commentid>
    <comment_count>10</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-10-04 02:01:09 +0000</bug_when>
    <thetext>So this made DOMException constructible, right?  I&apos;m not opposed to that, but no one implements that right this moment, yes?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112673</commentid>
    <comment_count>11</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2014-10-04 02:06:43 +0000</bug_when>
    <thetext>The spec already required it to be constructible before this change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112674</commentid>
    <comment_count>12</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2014-10-04 02:10:56 +0000</bug_when>
    <thetext>But yes I don&apos;t think that DOMExceptions are actually constructible in implementations yet.

One other thing hidden in this change that maybe I should have called out is that I made &quot;code&quot; a data property on the DOMException instance.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112676</commentid>
    <comment_count>13</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-10-04 02:15:33 +0000</bug_when>
    <thetext>Yeah, I did notice that.  And message and so forth.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112677</commentid>
    <comment_count>14</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2014-10-04 02:32:46 +0000</bug_when>
    <thetext>(In reply to Boris Zbarsky from comment #13)
&gt; Yeah, I did notice that.  And message and so forth.

Cool.  Though message was already a data property created during the constructor.

https://rawgit.com/heycam/webidl/6c153d257d4640662ee9ba239aa64a806a3845fd/index.html#es-exception-call</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>