1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Report more information on exception

This commit is contained in:
Ivan Savenko 2024-05-14 12:48:19 +00:00
parent 22d51bd473
commit 00728ded88

View File

@ -92,7 +92,7 @@ void NetworkConnection::onPacketReceived(const boost::system::error_code & ec, u
if (readBuffer.size() < expectedPacketSize) if (readBuffer.size() < expectedPacketSize)
{ {
throw std::runtime_error("Failed to read packet!"); throw std::runtime_error("Failed to read packet! " + std::to_string(readBuffer.size()) + " bytes read, but " + std::to_string(expectedPacketSize) + " bytes expected!");
} }
std::vector<std::byte> message(expectedPacketSize); std::vector<std::byte> message(expectedPacketSize);