RTCPeerConnectionIceErrorEvent: RTCPeerConnectionIceErrorEvent() constructor

Baseline 2026
Newly available

Since April 2026, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

The RTCPeerConnectionIceErrorEvent() constructor creates a new RTCPeerConnectionIceErrorEvent object with its type and other properties initialized as specified in the parameters.

Note that you will not normally create an object of this type yourself.

Syntax

js
new RTCPeerConnectionIceErrorEvent(type, options)

Parameters

type

A string with the name of the event. This is usually "icecandidateerror".

options

An object that, in addition to the properties defined in Event(), can have the following properties:

address Optional

A string indicating the local address used to communicate with the STUN or TURN server. This should be set to null if the local IP address has not yet been exposed as part of a local ICE candidate.

errorCode

A positive number providing the STUN error code returned by the STUN or TURN server. If no host candidate can reach the server and the iceGatheringState is gathering, this should be set to 701.

errorText Optional

A string providing the STUN reason text returned by the STUN or TURN server.

port Optional

A positive number indicating the local port used to communicate with the STUN or TURN server. This should be set to null if the connection hasn't been established (that is, if address is null).

url Optional

A string indicating the URL of the STUN or TURN server being used.

Return value

A new RTCPeerConnectionIceErrorEvent object.

Specifications

Specification
WebRTC: Real-Time Communication in Browsers
# dom-rtcpeerconnectioniceerrorevent-constructor

Browser compatibility