// Create WebSocket connection
const socket = new WebSocket("ws://localhost:8080");
// Listen for possible errors
socket.addEventListener("error", (event) => {
console.log("WebSocket error: ", event);
});
In this way I connect to Action Cable server:
import { createConsumer } from '@rails/actioncable'
export default createConsumer()
How to listen to connection errors in a similar way?