Error MakeError(const std::error_code& errorCode) { Error error; error.description = errorCode.message(); return error; }
LLVM_ATTRIBUTE_NORETURN void reportError(StringRef File, std::error_code EC) { assert(EC); errs() << ToolName << ": '" << File << "': " << EC.message() << ".\n"; exit(1); }
void protocol::handle_store_address(const std::error_code& ec) { if (ec) log_error(LOG_PROTOCOL) << "Failed to store address: " << ec.message(); }
static void reportError(StringRef Input, std::error_code EC) { if (Input == "-") Input = "<stdin>"; reportError(Twine(Input) + ": " + EC.message()); }
static void reportError(StringRef Input, std::error_code EC) { reportError(Twine(Input) + ": " + EC.message() + ".\n"); }
static ::testing::AssertionResult NoError(std::error_code EC) { if (!EC) return ::testing::AssertionSuccess(); return ::testing::AssertionFailure() << "error " << EC.value() << ": " << EC.message(); }
static void error(StringRef Prefix, std::error_code EC) { if (!EC) return; errs() << Prefix << ": " << EC.message() << "\n"; exit(1); }
future_error (std::error_code ec) : std::logic_error(ec.message()), m_ec(ec) { // pass }
service_error_t (std::error_code ec) : std::runtime_error(ec.message()), m_ec(ec) { // pass }
mastermind_error::mastermind_error(std::error_code error_code_) : std::runtime_error(error_code_.message()) , error_code(std::move(error_code_)) {}
static void exitWithErrorCode(std::error_code EC, StringRef Whence = "") { exitWithError(EC.message(), Whence); }
void bb(const std::error_code& ec, const message::block& blkhead) { log_debug() << ec.message(); log_debug() << hash_block_header(blkhead); }
void elf::error(std::error_code EC, const Twine &Prefix) { error(Prefix + ": " + EC.message()); }
SystemError(std::string msg, std::error_code const& ec) : Exception(msg + ": " + ec.message() + " (" + etc::to_string(ec) + ")") , _error_code{ec} {}
static void error(StringRef Filename, std::error_code EC) { if (!EC) return; errs() << Filename << ": " << EC.message() << "\n"; exit(1); }
static void error(std::error_code EC, const Twine &Prefix) { if (EC) error(Prefix + ": " + EC.message()); }
void handle_send_packet(const std::error_code& ec) { if (ec) log_error(LOG_POLLER) << "Send problem: " << ec.message(); }
void state_machine_t::shutdown(std::error_code ec) { if (shutdowned.exchange(true)) { return; } auto state = *this->state.synchronize(); COCAINE_LOG_DEBUG(log, "slave is shutting down from state %s: %s", state->name(), ec.message()); state->cancel(); if(state->terminating()) { // We don't consider any reason for termination in "terminating" state as an error ec.clear(); } migrate(std::make_shared<stopped_t>(ec)); fetcher.apply([&](std::shared_ptr<fetcher_t>& fetcher) { fetcher->close(); fetcher.reset(); }); if (ec && ec != error::overseer_shutdowning) { dump(); } data.channels.apply([&](channels_map_t& channels) { const auto size = channels.size(); if (size > 0) { COCAINE_LOG_WARNING(log, "slave is dropping %d sessions", size); } for (auto& channel : channels) { loop.post([=]() { channel.second->close_both(); }); } channels.clear(); }); // Check if the slave has been terminated externally. If so, do not call the cleanup callback. if (closed) { return; } // NOTE: To prevent deadlock between session.channels and overseer.pool. Consider some // other solution. const auto cleanup_handler = cleanup; loop.post([=]() { try { cleanup_handler(ec); } catch (const std::exception& err) { // Just eat an exception, we don't care why the cleanup handler failed to do its job. COCAINE_LOG_WARNING(log, "unable to cleanup after slave's death: %s", err.what()); } }); }
void locator_t::on_failure(const key_type& key, const std::error_code& ec) { std::string uuid; std::tie(uuid, std::ignore, std::ignore) = key; if(ec) { COCAINE_LOG_WARNING(m_log, "node '%s' has unexpectedly disconnected - [%d] %s", uuid, ec.value(), ec.message()); } else { COCAINE_LOG_WARNING(m_log, "node '%s' has unexpectedly disconnected", uuid); } auto removed = m_router->remove_remote(uuid); for(auto it = removed.begin(); it != removed.end(); ++it) { m_gateway->cleanup(uuid, it->first); } // NOTE: Safe to do since errors are queued up. m_remotes.erase(key); }
void handle_send(const std::error_code& ec) { if (ec) error_exit(ec.message()); log_info() << "handle_send"; }
void handle_send_get_data(const std::error_code& ec) { if (ec) log_error(LOG_SESSION) << "Requesting data: " << ec.message(); }
void logCloseFailed(std::error_code ec) { invariant(ec); LOG(1) << "failed to close stream: " << ec.message(); }
static void reportError(StringRef Input, std::error_code EC) { reportError(Input, EC.message()); }
void handle_blk(const std::error_code& ec, const message::block blk) { log_info() << "blk: " << ec.message() << " " << hash_block_header(blk); }
void error(std::error_code EC) { if (!EC) return; reportError(EC.message()); }
void NetworkInterfaceASIO::_networkErrorCallback(AsyncOp* op, const std::error_code& ec) { ErrorCodes::Error errorCode = (ec.category() == mongoErrorCategory()) ? ErrorCodes::fromInt(ec.value()) : ErrorCodes::HostUnreachable; _completeOperation(op, {errorCode, ec.message(), Milliseconds(now() - op->_start)}); }
void handle_send(const std::error_code& ec) { if (ec) log_error(LOG_PROTOCOL) << "Sending error: " << ec.message(); }
void NetworkInterfaceASIO::_networkErrorCallback(AsyncOp* op, const std::error_code& ec) { LOG(3) << "networking error occurred"; _completeOperation(op, Status(ErrorCodes::HostUnreachable, ec.message())); }
void handle_start(const std::error_code& ec) { if (ec) error_exit(ec.message()); }
void handle_send_packet(const std::error_code& ec) { if (ec) log_error(log_domain::poller) << "Send problem: " << ec.message(); }