We use Anycable client in React Native to work with our backend service. It works great in all cases of connecting, reconnecting, subscribing etc. but we see the following errors in Bagsnag:
Error: Cable is closed
Stacktrace:
/Users/vagrant/git/node_modules/@anycable/core/cable/index.js:257:17 send
send(msg) {
if (this.state === 'closed') {
throw Error('Cable is closed')
}
let data = this.encoder.encode(msg)
/Users/vagrant/git/node_modules/@anycable/core/action_cable_ext/index.js:155:19 ?anon_0_
// Send pongs asynchrounously—no need to block the main thread
async sendPong() {
await new Promise(resolve => setTimeout(resolve, 0))
this.cable.send({ command: 'pong' })
}
}
It doesn't break anything but it seems that the library doesn't handle its own throwing errors, does it? What are the approaches to handle errors from the library?
Hi!
We use Anycable client in React Native to work with our backend service. It works great in all cases of connecting, reconnecting, subscribing etc. but we see the following errors in Bagsnag:
It doesn't break anything but it seems that the library doesn't handle its own throwing errors, does it? What are the approaches to handle errors from the library?
Thanks in advance.