Commit 8d33536e authored by legoc's avatar legoc

Do not throw an exception in BaseHttpConnection when eof while receiving the response content

parent dea94ed3
......@@ -463,10 +463,14 @@ std::string BaseHttpConnection<SocketType, ConnectionSocketType>::send(bool verb
} while (errorCode == boost::asio::error::would_block);
// check error
if (errorCode) {
// in case of eof, the connection was closed cleanly by the peer so that we do not generate an exception.
if (errorCode != boost::asio::error::eof) {
// return with exception
throw boost::system::system_error(errorCode);
if (statusCode != 200) {
throw RequestException(std::string("response returned with status code ") + boost::lexical_cast<std::string>(statusCode) + "\n" + rs.str(), statusCode);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment