How do I catch the following error?
Uncaught (in promise) DOMException: RTCPeerConnection is gone (did you enter Offline mode?)
This error only happens in Mozilla Firefox. I have tried many things and have searched the internet but I can’t find a solution that works.
How to replicate:
- Open a WebRTC app in Mozilla Firefox
- Setup a call,
- Once the call is established, disconnect your device from the Internet
- Reconnect the device after about 4 seconds
From what I was able to gather, this is a Mozilla bug with how they handle call reconnection when the network is changed or disconnected temporarily. Bear in mind that Chrome handles this well and even if the call terminates, this error doesn’t throw.
I found this link quite informative.