0

I'm making a program to transmit data with WebRTC. I want to implement RTCDataChannel.onerror because I want to deal with an error event.

I read the document below, but the explanation is ambiguous. I want more specific information about the error. I want to know what happens when this method is called.

https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror

horita
  • 11
  • 4

1 Answers1

0

The RTCDataChannel.onerror is an attribute which you should set to a function. You should set the value of RTCDataChannel.onerror to a function which handles the error. For example:

RTCDataChannel.onerror = function(error) {
// handle the error
  alert("Uh oh, there is a problem. " + error);
}
Ryan Z
  • 2,657
  • 2
  • 8
  • 20