diff --git a/repertory/librepertory/src/comm/packet/packet_client.cpp b/repertory/librepertory/src/comm/packet/packet_client.cpp index ffd46744..e9a2fd9c 100644 --- a/repertory/librepertory/src/comm/packet/packet_client.cpp +++ b/repertory/librepertory/src/comm/packet/packet_client.cpp @@ -106,7 +106,7 @@ auto packet_client::check_version(std::uint32_t client_version, std::to_string(cfg_.api_port))); connect_timeout.disable(); if (not is_socket_still_alive(cli.socket)) { - utils::error::raise_error(function_name, e, "failed to connect"); + throw std::runtime_error("failed to connect"); } comm::apply_common_socket_properties(cli.socket); @@ -128,8 +128,9 @@ auto packet_client::check_version(std::uint32_t client_version, } auto packet_client::connect(client &cli) -> bool { - try { + REPERTORY_USES_FUNCTION_NAME(); + try { timeout connect_timeout( [&cli]() { event_system::instance().raise("connect", @@ -144,7 +145,7 @@ auto packet_client::connect(client &cli) -> bool { connect_timeout.disable(); if (not is_socket_still_alive(cli.socket)) { - utils::error::raise_error(function_name, e, "failed to connect"); + throw std::runtime_error("failed to connect"); } comm::apply_common_socket_properties(cli.socket); @@ -417,7 +418,7 @@ void packet_client::write_data(client &cli, const packet &request) const { throw std::runtime_error("write failed|" + std::to_string(bytes_written)); } offset += static_cast(bytes_written); - read_timeout.reset(); + write_timeout.reset(); } } } // namespace repertory