Example #1
0
Error MakeError(const std::error_code& errorCode)
{
    Error error;
    error.description = errorCode.message();
    return error;
}
Example #2
0
LLVM_ATTRIBUTE_NORETURN void reportError(StringRef File, std::error_code EC) {
  assert(EC);
  errs() << ToolName << ": '" << File << "': " << EC.message() << ".\n";
  exit(1);
}
Example #3
0
void protocol::handle_store_address(const std::error_code& ec)
{
    if (ec)
        log_error(LOG_PROTOCOL) << "Failed to store address: " << ec.message();
}
Example #4
0
static void reportError(StringRef Input, std::error_code EC) {
  if (Input == "-")
    Input = "<stdin>";

  reportError(Twine(Input) + ": " + EC.message());
}
Example #5
0
static void reportError(StringRef Input, std::error_code EC) {
  reportError(Twine(Input) + ": " + EC.message() + ".\n");
}
Example #6
0
static ::testing::AssertionResult NoError(std::error_code EC) {
  if (!EC)
    return ::testing::AssertionSuccess();
  return ::testing::AssertionFailure() << "error " << EC.value() << ": "
                                       << EC.message();
}
Example #7
0
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
 }
Example #10
0
mastermind_error::mastermind_error(std::error_code error_code_)
	: std::runtime_error(error_code_.message())
	, error_code(std::move(error_code_))
{}
Example #11
0
static void exitWithErrorCode(std::error_code EC, StringRef Whence = "") {
  exitWithError(EC.message(), Whence);
}
Example #12
0
void bb(const std::error_code& ec, const message::block& blkhead)
{
    log_debug() << ec.message();
    log_debug() << hash_block_header(blkhead);
}
Example #13
0
void elf::error(std::error_code EC, const Twine &Prefix) {
  error(Prefix + ": " + EC.message());
}
Example #14
0
		SystemError(std::string msg, std::error_code const& ec)
			: Exception(msg + ": " + ec.message() + " (" + etc::to_string(ec) + ")")
			, _error_code{ec}
		{}
Example #15
0
static void error(StringRef Filename, std::error_code EC) {
  if (!EC)
    return;
  errs() << Filename << ": " << EC.message() << "\n";
  exit(1);
}
Example #16
0
static void error(std::error_code EC, const Twine &Prefix) {
  if (EC)
    error(Prefix + ": " + EC.message());
}
Example #17
0
void handle_send_packet(const std::error_code& ec)
{
    if (ec)
        log_error(LOG_POLLER) << "Send problem: " << ec.message();
}
Example #18
0
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());
        }
    });
}
Example #19
0
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);
}
Example #20
0
void handle_send(const std::error_code& ec)
{
    if (ec)
        error_exit(ec.message());
    log_info() << "handle_send";
}
Example #21
0
void handle_send_get_data(const std::error_code& ec)
{
    if (ec)
        log_error(LOG_SESSION) << "Requesting data: " << ec.message();
}
Example #22
0
void logCloseFailed(std::error_code ec) {
    invariant(ec);
    LOG(1) << "failed to close stream: " << ec.message();
}
Example #23
0
static void reportError(StringRef Input, std::error_code EC) {
  reportError(Input, EC.message());
}
Example #24
0
void handle_blk(const std::error_code& ec, const message::block blk)
{
    log_info() << "blk: " << ec.message() << " " << hash_block_header(blk);
}
Example #25
0
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)});
}
Example #27
0
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()));
}
Example #29
0
void handle_start(const std::error_code& ec)
{
    if (ec)
        error_exit(ec.message());
}
Example #30
0
void handle_send_packet(const std::error_code& ec)
{
    if (ec)
        log_error(log_domain::poller)
            << "Send problem: " << ec.message();
}