Catch runtime error writing to socket
This commit is contained in:
@@ -9,7 +9,14 @@
|
|||||||
void ConnectionOperator::SendResponse(Connection const & connection, Http::Response const & response) const
|
void ConnectionOperator::SendResponse(Connection const & connection, Http::Response const & response) const
|
||||||
{
|
{
|
||||||
auto bytesToSend = response.Serialize();
|
auto bytesToSend = response.Serialize();
|
||||||
|
try
|
||||||
|
{
|
||||||
connection.WriteBytes(bytesToSend);
|
connection.WriteBytes(bytesToSend);
|
||||||
|
}
|
||||||
|
catch(std::runtime_error & e)
|
||||||
|
{
|
||||||
|
Logger::GetInstance().Error("Error writing data to connection");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionOperator::HandleNewConnection(Connection const & newConnection)
|
void ConnectionOperator::HandleNewConnection(Connection const & newConnection)
|
||||||
|
|||||||
Reference in New Issue
Block a user