Error handling 何时调用RTCDataChannel.onerror?

Error handling 何时调用RTCDataChannel.onerror?,error-handling,webrtc,onerror,rtcdatachannel,Error Handling,Webrtc,Onerror,Rtcdatachannel,我正在制作一个用WebRTC传输数据的程序。我想实现RTCDataChannel.onerror,因为我想处理一个错误事件 我读了下面的文件,但解释不明确。我想要关于错误的更具体的信息。我想知道调用此方法时会发生什么 RTCDataChannel.onerror是一个属性,您应该将其设置为函数。您应该将RTCDataChannel.onerror的值设置为处理错误的函数。例如: RTCDataChannel.onerror = function(error) { // handle the er

我正在制作一个用WebRTC传输数据的程序。我想实现RTCDataChannel.onerror,因为我想处理一个错误事件

我读了下面的文件,但解释不明确。我想要关于错误的更具体的信息。我想知道调用此方法时会发生什么


RTCDataChannel.onerror是一个属性,您应该将其设置为函数。您应该将
RTCDataChannel.onerror
的值设置为处理错误的函数。例如:

RTCDataChannel.onerror = function(error) {
// handle the error
  alert("Uh oh, there is a problem. " + error);
}