Skip to content

Attempting to connect to a nonexistent server doesn't throw a ButtplugError #284

@EskCresh

Description

@EskCresh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions