Ejemplo n.º 1
0
void Connection::notify_error(const std::string& error) {
  if (state_ == CONNECTION_STATE_READY) {
    LOG_ERROR("Host %s had the following error: %s",
              addr_string_.c_str(), error.c_str());
  } else {
    LOG_ERROR("Host %s had the following error on startup: %s",
              addr_string_.c_str(), error.c_str());
  }
  defunct();
}
Ejemplo n.º 2
0
void Connection::notify_error(const std::string& message, ConnectionError code) {
  assert(code != CONNECTION_OK && "Notified error without an error");
  LOG_DEBUG("Lost connection(%p) to host %s with the following error: %s",
            static_cast<void*>(this),
            host_->address_string().c_str(),
            message.c_str());
  error_message_ = message;
  error_code_ = code;
  if (code == Connection::CONNECTION_ERROR_SSL) {
    ssl_error_code_ = ssl_session_->error_code();
  }
  defunct();
}