W3C home > Mailing lists > Public > public-webrtc@w3.org > May 2016

Which error do I report?

From: Eric Rescorla <ekr@rtfm.com>
Date: Fri, 27 May 2016 08:01:04 -0700
Message-ID: <CABcZeBN7Yj_OaxE_GrSD5WByoSsjwi6ee6e4-b7R9g+bzW=iug@mail.gmail.com>
To: "public-webrtc@w3.org" <public-webrtc@w3.org>
Section 4.3.1. reads in part:


   If the process to apply description fails for any reason, then user
   agent must queue a task runs the following steps:

      If connection's [[isClosed
      <http://w3c.github.io/webrtc-pc/#dfn-isclosed>]] slot is true, then
      abort these steps.

      If elements of the SDP were modified in an invalid way as specified
      in [JSEP <http://w3c.github.io/webrtc-pc/#bib-JSEP>] (section 6.
      then reject p with an InvalidModificationError and abort these steps.

      If the description's type
      <http://w3c.github.io/webrtc-pc/#dom-rtcsessiondescription-type> is
      wrong for the current signaling state
      <http://w3c.github.io/webrtc-pc/#dfn-signaling-state> of connection,
      then reject p with aInvalidStateError and abort these steps.

      If the content of description is invalid, then reject p with an
      InvalidAccessError and abort these steps.

      For all other errors, for example if description cannot be applied at
      the media layer, reject p withOperationError.

Consider what happens if I invalidly modify an SDP *and* the PC is in the
wrong state. This algorithm clearly tells you that you should be returning
InvalidModificationError, which doesn't seem sensible.

In general, I don't think the spec should be requiring a specific order of
error checking.

Received on Friday, 27 May 2016 15:02:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:18:16 UTC