summaryrefslogtreecommitdiff
path: root/src/network/socket_handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/socket_handler.cpp')
-rw-r--r--src/network/socket_handler.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/network/socket_handler.cpp b/src/network/socket_handler.cpp
index 484aa8f..4dab214 100644
--- a/src/network/socket_handler.cpp
+++ b/src/network/socket_handler.cpp
@@ -75,7 +75,11 @@ void SocketHandler::on_recv(const size_t nb)
this->close();
}
else if (-1 == static_cast<ssize_t>(size))
- throw std::runtime_error("Error reading from socket");
+ {
+ log_warning("Error while reading from socket: " << strerror(errno));
+ this->on_connection_close();
+ this->close();
+ }
else
{
this->in_buf += std::string(buf, size);