I attempted to initiate a connection while Intiface was closed to trigger a connection error, as in:
connector = new buttplug.ButtplugBrowserWebsocketClientConnector('ws://127.0.0.1:12345');
client = new buttplug.ButtplugClient('test');
try {
await client.connect(connector);
} catch(e) {
console.log(e);
console.log(e.name);
console.log(e.message);
}
My intent was to be able to use the error details for more robust logging. I figured it would be of type ButtplugClientConnectorException, but at least of ButtplugErrror, or even Error. Instead, I got an Event with type: "error" and target of the WebSocket object. I'm not sure what other WebSocket issues might return Events.