Class WebSocketErrorEventWearable Only

Event type for WebSocket error events. This event indicates when a server-side error has occurred resulting in closure of the WebSocket connection. Listen for this event by using addEventListener with error, or by setting the onerror property.

websocket.onerror = (event) => {
print("The connection has been closed due to an error: " + error);
};

Hierarchy (View Summary)

Constructors

Methods

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean