Skip to content

Commit

Permalink
Merge pull request #472 from w3c/errorManagement
Browse files Browse the repository at this point in the history
Update error reports to align with existing DOM Errors
  • Loading branch information
burnburn committed Feb 4, 2016
2 parents e6bdd7a + d79e43b commit 2774184
Showing 1 changed file with 18 additions and 71 deletions.
89 changes: 18 additions & 71 deletions webrtc.html
Expand Up @@ -494,7 +494,7 @@ <h4>Operation</h4>
<p>If the <code>certificates</code> value in
the <code>RTCConfiguration</code> structure is non-empty, check that
the <code>expires</code> on each value is in the future. If a
certificate has expired, throw an <code>InvalidParameter</code>
certificate has expired, throw an <code>InvalidAccessError</code>
exception and abort these steps; otherwise, store the certificates.
If no <code>certificates</code> value was specified, one or more
new <code>RTCCertificate</code> instances are generated for use with
Expand Down Expand Up @@ -684,20 +684,22 @@ <h4>Operation</h4>
</li>

<li>
<p>If the content of <var>description</var> is invalid or if
<var>description</var>'s <code><a href=
<p>If the <var>description</var>'s <code><a href=
"#widl-RTCSessionDescription-type">type</a></code> is wrong for
the current <a>signaling state</a> of
<var>connection</var>, then reject <var>p</var> with an
<code>InvalidSessionDescriptionError</code> and abort these
<var>connection</var>, then reject <var>p</var> with a <code>InvalidStateError</code> and abort these steps.</p>

<p>If the content of <var>description</var> is invalid,
then reject <var>p</var> with an
<code>InvalidAccessError</code> and abort these
steps.</p>
</li>

<li>
<p>If <var>description</var> cannot be applied at the media
layer, but the User Agent recovered, possibly by rolling back
to the previous configuration, then reject <var>p</var> with
<code>IncompatibleSessionDescriptionError</code> and abort
<code>OperationError</code> and abort
these steps.</p>

<p>This occurs, for example, when the version of
Expand All @@ -717,7 +719,7 @@ <h4>Operation</h4>
</li>

<li>
<p>Reject <var>p</var> with <code>InternalError</code>.</p>
<p>Reject <var>p</var> with <code>OperationError</code>.</p>
</li>
</ol>
</li>
Expand Down Expand Up @@ -996,7 +998,7 @@ <h3>Interface Definition</h3>
session description SHALL contain an appropriate assertion. If the
identity provider is unable to produce an identity assertion, the
call to <code>createOffer</code> MUST be rejected with a
<code>DOMException</code> that has a name of <code>IdpError</code>.</p>
<code>DOMException</code> that has a name of <code>NotReadableError</code>.</p>

<p>If this <code>RTCPeerConnection</code> object is closed before
the SDP generation process completes, the user agent MUST suppress
Expand All @@ -1018,7 +1020,7 @@ <h3>Interface Definition</h3>

<p>If the SDP generation process failed for any other reason, the
user agent MUST reject the returned promise with an
<code>DOMException</code> object of type TBD as its argument.</p>
<code>DOMException</code> object of type <code>OperationError</code> as its argument.</p>
</dd>

<dt>Promise&lt;RTCSessionDescription&gt; createAnswer (optional
Expand Down Expand Up @@ -1060,7 +1062,7 @@ <h3>Interface Definition</h3>
session description SHALL contain an appropriate assertion. If the
identity provider is unable to produce an identity assertion, the
call to <code>createAnswer</code> MUST be rejected with a
<code>DOMException</code> that has a name of <code>IdpError</code>.</p>
<code>DOMException</code> that has a name of <code>NotReadableError</code>.</p>

<p>If this <code>RTCPeerConnection</code> object is closed before
the SDP generation process completes, the user agent MUST suppress
Expand All @@ -1073,8 +1075,8 @@ <h3>Interface Definition</h3>

<p>If the SDP generation process failed for any reason, the user
agent MUST reject the returned promise with a <code>DOMException</code>
object of type TBD.</p>
<p data-number="319" class="issue">TODO: define type of error for SDP generation</p>
object of type <code>OperationError</code>.</p>

</dd>

<dt>Promise&lt;void&gt; setLocalDescription (
Expand Down Expand Up @@ -1197,7 +1199,7 @@ <h3>Interface Definition</h3>
<p>The <a href="#target-peer-identity">target peer identity</a>
cannot be changed once set. Once set, if a different value is
provided, the user agent MUST reject the returned promise with
<code>IncompatibleSessionDescriptionError</code> and abort this
<code>InvalidModificationError</code> and abort this
operation. The <code><a>RTCPeerConnection</a></code> MUST be closed
if the validated peer identity does not match the <a href=
"#target-peer-identity">target peer identity</a>.</p>
Expand Down Expand Up @@ -1302,9 +1304,7 @@ <h3>Interface Definition</h3>
<li>
<p>If the candidate could not be successfully applied, return a promise
rejected with a <code>DOMException</code> object whose <code>name</code>
attribute has the value TBD.</p>
<p class="issue">TODO: define names for DOMException
(InvalidCandidate and InvalidMidIndex (see also <a href="https://github.com/w3c/webrtc-pc/issues/319">Issue 319</a>))</p>
attribute has the value <code>OperationError</code>.</p>
</li>

<li>
Expand All @@ -1320,12 +1320,6 @@ <h3>Interface Definition</h3>
<p>Return <var>p</var>.</p>
</li>
</ol>

<div class="issue">
What errors do we need here? Should we reuse the
*SessionDescriptionError names or invent new ones for candidates?
Should this method be queued? (see also <a href="https://github.com/w3c/webrtc-pc/issues/319">Issue 319</a>)
</div>
</dd>

<dt>readonly attribute RTCSignalingState signalingState</dt>
Expand Down Expand Up @@ -1531,10 +1525,6 @@ <h3>Interface Definition</h3>
</li>
</ol>

<div class="issue">
The exception types throw in the above algorithm are provisional
(until we decide what to do in each case). See also <a href="https://github.com/w3c/webrtc-pc/issues/319">Issue 319</a>
</div>
</dd>

<dt>void close ()</dt>
Expand Down Expand Up @@ -2163,47 +2153,6 @@ <h4>General Principles</h4>
MUST provide an error object to the error callback.</p>
</section>

<section>
<h4>RTCSdpError</h4>

<dl class="idl" title="interface RTCSdpError">
<dt>readonly attribute unsigned long sdpLineNumber</dt>

<dd>The line number of an <code><a>RTCSessionDescriptionInit</a></code>
at which the error was encountered.</dd>
</dl>

<div class="issue">
<p>(see also <a href="https://github.com/w3c/webrtc-pc/issues/319">Issue 319</a>)</p>
<p>Ask the DOM team to extend their list with the following errors.
The error names and their descriptions are directly copied from the
old RTCErrorName enum and might need some adjustment before being
added to the public list of errors.</p>

<ul>
<li>InvalidSessionDescriptionError: The provided
RTCSessionDescriptionInit contained invalid SDP, or the type was wrong
for the current state of the RTCPeerConnection. User agents SHOULD
provide as much additional information in the error message as
possible, including the sdpLineNumber, if appropriate.</li>

<li>IncompatibleSessionDescriptionError: The provided
RTCSessionDescriptionInit contained SDP that could not be correctly
applied to the RTCPeerConnection due to its current state. User
agents SHOULD provide as much additional information in the error
message as possible, including the sdpLineNumber, if
appropriate.</li>

<li>IncompatibleConstraintsError: The provided MediaConstraints
could not be correctly applied to the RTCPeerConnection due to its
current state. User agents SHOULD provide as much additional
information in the error message as possible.</li>

<li>InternalError: The RTCPeerConnection encountered an error that
it could not recover from.</li>
</ul>
</div>
</section>
</section>

<section>
Expand Down Expand Up @@ -2997,7 +2946,7 @@ <h3>RTCPeerConnection Interface Extensions</h3>
<li>
<p>If an <code>RTCRtpSender</code> for <var>track</var> already exists in
<var>connection</var>'s <a href="#senders-set">set of senders</a>,
throw an <code>InvalidParameter</code> exception and abort these
throw an <code>InvalidAccessError</code> exception and abort these
steps.</p>
</li>

Expand Down Expand Up @@ -5313,8 +5262,6 @@ <h4>RTCDTMFSender</h4>
of RTP packets but it MUST not increase either of them by more than
the duration of a single RTP audio packet.</p>

<p class="issue">How are invalid values handled? (see also <a href="https://github.com/w3c/webrtc-pc/issues/319">Issue 319</a>)</p>

<p>When the <code><a>insertDTMF()</a></code> method is invoked, the
user agent MUST run the following steps:</p>

Expand Down Expand Up @@ -6241,7 +6188,7 @@ <h3 id="sec.identity-verify-assertion">Verifying Identity Assertions</h3>
the <code><a href=
"#widl-RTCPeerConnection-peerIdentity">peerIdentity</a></code> promise is
rejected with a <code>DOMException</code> that has a name of
<code>IdpError</code>.</p>
<code>OperationError</code>.</p>

<p>If identity validation fails and there is
a <a href="#target-peer-identity">target peer identity</a> for the
Expand Down

0 comments on commit 2774184

Please sign in to comment.