11.1 RTCError Interface

  1. WebIDL[Exposed=Window]
  2. interface RTCError : DOMException {
  3. constructor(RTCErrorInit init, optional DOMString message = "");
  4. readonly attribute RTCErrorDetailType errorDetail;
  5. readonly attribute long? sdpLineNumber;
  6. readonly attribute long? sctpCauseCode;
  7. readonly attribute unsigned long? receivedAlert;
  8. readonly attribute unsigned long? sentAlert;
  9. };

11.1.1 Constructors

constructor()

Run the following steps:

  1. Let init be the constructor’s first argument.

  2. Let message be the constructor’s second argument.

  3. Let e be a new RTCError object.

  4. Invoke the DOMException constructor of e with the message argument set to message and the name argument set to "OperationError".

    Note

    This name does not have a mapping to a legacy code so e.code will return 0.

  5. Set all RTCError attributes of e to the value of the corresponding attribute in init if it is present, otherwise set it to null.

  6. Return e.

11.1.2 Attributes

errorDetail of type RTCErrorDetailType, readonly

The WebRTC-specific error code for the type of error that occurred.

sdpLineNumber of type long, readonly, nullable

If errorDetail is “sdp-syntax-error“ this is the line number where the error was detected (the first line has line number 1).

sctpCauseCode of type long, readonly, nullable

If errorDetail is “sctp-failure“ this is the SCTP cause code of the failed SCTP negotiation.

receivedAlert of type unsigned long, readonly, nullable

If errorDetail is “dtls-failure“ and a fatal DTLS alert was received, this is the value of the DTLS alert received.

sentAlert of type unsigned long, readonly, nullable

If errorDetail is “dtls-failure“ and a fatal DTLS alert was sent, this is the value of the DTLS alert sent.

(Feature at Risk) Issue 1

All attributes defined in RTCError are marked at risk due to lack of implementation (errorDetail, sdpLineNumber, sctpCauseCode, receivedAlert and sentAlert). This does not include attributes inherited from DOMException.