Skip to content

Console warning on WSS close #1

@grctest

Description

@grctest

When a websocket is closed, an error message is logged in the console:

undefined
error: wss connection closed

This is because of the following lines in the ChainWebSocket:

 // in onClose function:

    for (var cbId = this.responseCbId + 1; cbId <= this.cbId; cbId += 1) {
      this.callbacks[cbId].reject("wss connection closed");
    }

  .......

  login = (user, password) => this.connect_promise.then(() => this.call([1, "login", [user, password]]));

So we could change the onClose function to avoid throwing an error on WSS closure. Resolving instead of rejecting isn't an option neither.

Upside is this isn't blocking, just cosmetic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions