<?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>25896</bug_id>
          
          <creation_ts>2014-05-27 19:00:32 +0000</creation_ts>
          <short_desc>Why is EME creating new DOMException subclasses?</short_desc>
          <delta_ts>2014-09-16 00:44:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>Encrypted Media Extensions</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>
          
          <blocked>23367</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="David Dorwin">ddorwin</assigned_to>
          <cc>annevk</cc>
    
    <cc>cpearce</cc>
    
    <cc>ddorwin</cc>
    
    <cc>jdsmith</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-media</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>106850</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-05-27 19:00:32 +0000</bug_when>
    <thetext>I thought we were trying to avoid creating new types of exception objects in the platform.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106851</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-27 19:51:02 +0000</bug_when>
    <thetext>Yes we are. Hopefully we can avoid implementing this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106863</commentid>
    <comment_count>2</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2014-05-27 22:45:51 +0000</bug_when>
    <thetext>As far as I know, there are no implementations of this yet.

The discussion of this starts in https://www.w3.org/Bugs/Public/show_bug.cgi?id=23619#c6. In the 10th comment, Microsoft wanted systemCode to remain accessible.

If subclassing is discouraged and the advice in the advice on using DOMException for all errors is still accurate, we should replace MediaKeyError with DOMException. Implementations could choose to report system error codes in the DOMException message.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106894</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-28 07:43:42 +0000</bug_when>
    <thetext>That sounds acceptable, if it is indeed phrased as a hint towards UAs (with regards to exposing system error codes) and not a requirement as no normative requirements can be made on the contents of .message.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107865</commentid>
    <comment_count>4</comment_count>
    <who name="Jerry Smith">jdsmith</who>
    <bug_when>2014-06-16 19:07:01 +0000</bug_when>
    <thetext>Providing a discrete systemCode for clarity still seems preferable.  A DOMException message could get mingled with errors unrelated to EME.  That could be resolved by adding a clear exception type to the WebIDL, but I&apos;ve seen some language that appears to discourage doing that.  If so, we could end up using an existing type (or types), like SyntaxError for these messages.

If we do go in this direction, we should preserve the intent of this MediaKeyError text (though modify it to remove the obsolete attribute):  

The systemCode attribute of a MediaKeySession object is a Key System-specific value for the error that occurred. This allows a more granular status to be returned than the more general name. It should be 0 if there is no associated status code or such status codes are not supported by the Key System.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107917</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-06-17 05:42:53 +0000</bug_when>
    <thetext>Jerry, if it&apos;s key-system specific it seems you should include such details in the message field.

They consideration here is whether you would expect branching to happen based on the exception that is returned. Typically the only thing that happens with exceptions is that they are reported back to the server for debugging.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108711</commentid>
    <comment_count>6</comment_count>
    <who name="Jerry Smith">jdsmith</who>
    <bug_when>2014-07-03 21:04:02 +0000</bug_when>
    <thetext>I&apos;ve had more discussions on this.  We prefer returning a numeric error code.  It is correct that this is key-system specific.  Is it possible to augment DOMString with an systemCode attribute on the MediaKeySession?  The DOMException message might then identify the exception as Media Key related.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108716</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-04 05:43:29 +0000</bug_when>
    <thetext>No, it seems it should just go in the exception message. What&apos;s the expected usage scenario where it makes sense for this to be exposed as a distinct field only useful for your key system?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108762</commentid>
    <comment_count>8</comment_count>
    <who name="Jerry Smith">jdsmith</who>
    <bug_when>2014-07-07 16:56:10 +0000</bug_when>
    <thetext>The current MediaKeyError provides a numeric systemCode that is key system specific.  This would retain that.  The DOMException message returns string error descriptions.  We prefer a numeric error code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108853</commentid>
    <comment_count>9</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-11 08:37:46 +0000</bug_when>
    <thetext>Yes I understand you want that, but you have not justified it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108870</commentid>
    <comment_count>10</comment_count>
    <who name="Jerry Smith">jdsmith</who>
    <bug_when>2014-07-11 19:02:52 +0000</bug_when>
    <thetext>The specific concern is that mixing numeric values with text in the DOMException message may make parsing and logging of the numeric value more difficult.  There&apos;s potential for the message content to vary by CDM.  The end goal is to be able to accurately parse and log numeric error values.

If there&apos;s an existing approach for doing this without a separate numeric error code, please provide a reference to it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108900</commentid>
    <comment_count>11</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-14 07:43:36 +0000</bug_when>
    <thetext>There is no existing approach for proprietary exceptions. Leaking through details of the CDM like that seems bad.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109102</commentid>
    <comment_count>12</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2014-07-19 01:33:06 +0000</bug_when>
    <thetext>https://dvcs.w3.org/hg/html-media/rev/3368787fe08e removes systemCode as part of a larger removal of definitions that seem likely to change once bug 26372 is resolved. I think we can close this bug and make sure that the solution to bug 26372 does not include subclassing DOMException.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109317</commentid>
    <comment_count>13</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-07-27 11:28:36 +0000</bug_when>
    <thetext>Thanks David, sounds good.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111566</commentid>
    <comment_count>14</comment_count>
    <who name="Jerry Smith">jdsmith</who>
    <bug_when>2014-09-16 00:44:41 +0000</bug_when>
    <thetext>This bug was closed because the underlying issue with extending DOMExceptions was resolved.

The SystemCode discussion from this bug is continued on Bug 26776 - Diagnosing and resolving CDM errors needs a numeric systemCode (deleted with MediaKeyError).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>