lib/websocket.js
function socketOnError() {
  const websocket = this[kWebSocket];

  this.removeListener('error', socketOnError);
  this.on('error', NOOP);

  websocket.readyState = WebSocket.CLOSING;
  this.destroy();
}
function socketOnError() {
  const websocket = this[kWebSocket];

  this.removeListener('error', socketOnError);
  this.on('error', NOOP);

  websocket.readyState = WebSocket.CLOSING;
  this.destroy();
}
function socketOnError ( ) { const websocket = this [ kWebSocket ] ; this . removeListener ( 'error' , socketOnError ) ; this . on ( 'error' , NOOP ) ; websocket . readyState = WebSocket . CLOSING ; this . destroy ( ) ; }
The listener of the `net.Socket` `'error'` event.

@private
The listener of the net . Socket error event .