return a internal server error when a exception is thrown during the read() operation for REST API calls;

pull/121/merge
Bryan Biedenkapp 1 month ago
parent 3c85caa482
commit 6c9883a084

@ -197,9 +197,12 @@ namespace restapi
} }
} }
catch(const std::exception& e) { catch(const std::exception& e) {
::LogError(LOG_REST, "SecureServerConnection::read(), %s", ec.message().c_str()); ::LogError(LOG_REST, "SecureServerConnection::read(), %s %s", e.what(), ec.message().c_str());
m_continue = false; m_continue = false;
m_contResult = HTTPLexer::INDETERMINATE; m_contResult = HTTPLexer::INDETERMINATE;
m_reply = HTTPPayload::statusPayload(HTTPPayload::INTERNAL_SERVER_ERROR);
write();
} }
} }
else if (ec != asio::error::operation_aborted) { else if (ec != asio::error::operation_aborted) {

@ -180,9 +180,12 @@ namespace restapi
} }
} }
catch(const std::exception& e) { catch(const std::exception& e) {
::LogError(LOG_REST, "ServerConnection::read(), %s", ec.message().c_str()); ::LogError(LOG_REST, "ServerConnection::read(), %s %s", e.what(), ec.message().c_str());
m_continue = false; m_continue = false;
m_contResult = HTTPLexer::INDETERMINATE; m_contResult = HTTPLexer::INDETERMINATE;
m_reply = HTTPPayload::statusPayload(HTTPPayload::INTERNAL_SERVER_ERROR);
write();
} }
} }
else if (ec != asio::error::operation_aborted) { else if (ec != asio::error::operation_aborted) {

Loading…
Cancel
Save

Powered by TurnKey Linux.