private function shouldBeConnected()
{
// If we lost the connection, first let's try and reconnect
if (!$this->isConnected()) {
try {
$this->switchNodeIfNeeded();
} catch (ConnectionException $e) {
throw new ConnectionException('Not connected. ' . $e->getMessage());
}
}
}