diff options
author | Sunitha Harish <sunithaharish04@gmail.com> | 2023-07-11 12:49:03 +0300 |
---|---|---|
committer | Sunitha Harish <sunithaharish04@gmail.com> | 2023-07-11 12:49:03 +0300 |
commit | d7043b3aeb9029321be973f1affd037c3743202c (patch) | |
tree | 597fa1b1e580cffa0fad1328dd2ba04c83b4ea67 /http/http_client.hpp | |
parent | 5db33d60ca6c3be2b799f5fd0fd311c37917fd70 (diff) | |
download | bmcweb-d7043b3aeb9029321be973f1affd037c3743202c.tar.xz |
HTTP Client: Improve error message
This commit adds the host and port data to the existing error messages
that are hit during redfish event
Tested by:
Checked the traces on BMC when there is a bad subscriber
Change-Id: I3f18bc3b999c136c42c4c0021c5fcadddb9e4bff
Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com>
Diffstat (limited to 'http/http_client.hpp')
-rw-r--r-- | http/http_client.hpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/http/http_client.hpp b/http/http_client.hpp index dea4d50c67..15338756df 100644 --- a/http/http_client.hpp +++ b/http/http_client.hpp @@ -180,7 +180,8 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo> { if (ec || (endpointList.empty())) { - BMCWEB_LOG_ERROR << "Resolve failed: " << ec.message(); + BMCWEB_LOG_ERROR << "Resolve failed: " << ec.message() << " " + << host << ":" << std::to_string(port); state = ConnState::resolveFailed; waitAndRetry(); return; @@ -315,7 +316,8 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo> timer.cancel(); if (ec) { - BMCWEB_LOG_ERROR << "sendMessage() failed: " << ec.message(); + BMCWEB_LOG_ERROR << "sendMessage() failed: " << ec.message() << " " + << host << ":" << std::to_string(port); state = ConnState::sendFailed; waitAndRetry(); return; @@ -368,7 +370,8 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo> timer.cancel(); if (ec && ec != boost::asio::ssl::error::stream_truncated) { - BMCWEB_LOG_ERROR << "recvMessage() failed: " << ec.message(); + BMCWEB_LOG_ERROR << "recvMessage() failed: " << ec.message() + << " from " << host << ":" << std::to_string(port); state = ConnState::recvFailed; waitAndRetry(); return; @@ -387,7 +390,8 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo> // The listener failed to receive the Sent-Event BMCWEB_LOG_ERROR << "recvMessage() Listener Failed to " "receive Sent-Event. Header Response Code: " - << respCode; + << respCode << " from " << host << ":" + << std::to_string(port); state = ConnState::recvFailed; waitAndRetry(); return; @@ -437,7 +441,8 @@ class ConnectionInfo : public std::enable_shared_from_this<ConnectionInfo> if ((retryCount >= connPolicy->maxRetryAttempts) || (state == ConnState::sslInitFailed)) { - BMCWEB_LOG_ERROR << "Maximum number of retries reached."; + BMCWEB_LOG_ERROR << "Maximum number of retries reached." + << " " << host << ":" << std::to_string(port); BMCWEB_LOG_DEBUG << "Retry policy: " << connPolicy->retryPolicyAction; @@ -766,7 +771,8 @@ class ConnectionPool : public std::enable_shared_from_this<ConnectionPool> } else if (requestQueue.size() < maxRequestQueueSize) { - BMCWEB_LOG_ERROR << "Max pool size reached. Adding data to queue."; + BMCWEB_LOG_ERROR << "Max pool size reached. Adding data to queue." + << destIP << ":" << std::to_string(destPort); requestQueue.emplace_back(std::move(thisReq), std::move(cb)); } else |