WebSocketServer.php
function onError(ConnectionInterface $conn, \Exception $e)
    {
        $this->trigger(self::EVENT_CLIENT_ERROR, new WSClientErrorEvent([
            'client' => $conn,
            'exception' => $e
        ]));

        if ($this->closeConnectionOnError) {
            $conn->close();
        }
    }
function onError(ConnectionInterface $conn, \Exception $e)
    {
        $this->trigger(self::EVENT_CLIENT_ERROR, new WSClientErrorEvent([
            'client' => $conn,
            'exception' => $e
        ]));

        if ($this->closeConnectionOnError) {
            $conn->close();
        }
    }
@param ConnectionInterface $conn
@param \Exception $e

@event WSClientErrorEvent EVENT_CLIENT_ERROR