我目前使用的是feross的simple-peer库,有时我会得到这样的错误:
Uncaught Error: Ice connection failed.
at r._onIceStateChange
at RTCPeerConnection.t._pc.oniceconnectionstatechange 这个错误直接来自于库,我不确定如何在不编辑它的情况下捕获它。有没有办法在我的脚本中而不是在库中实现类似于try > catch的东西?
发布于 2018-10-01 21:09:27
您可以为进程使用全局错误处理程序,
process
.on('unhandledRejection', (reason, p) => {
// HANDLE ERROR HERE
})
.on('uncaughtException', err => {
// HANDLE ERROR HERE
});https://stackoverflow.com/questions/52590876
复制相似问题