Rename all error_code instances to ec
We're not consistent here, which leads to people copying and pasting
code all over, which has lead to a bunch of different names for error
codes.
This commit changes to coerce them all to "ec", because that's what
boost uses for a naming convention.
Tested: Rename only, code compiles.
Change-Id: I7053cc738faa9f7a82f55fc46fc78618bdf702a5
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index 56cd492..cb469bd 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -576,13 +576,13 @@
dbus::utility::getManagedObjects(
service, path,
[callback,
- ldapType](const boost::system::error_code& errorCode,
+ ldapType](const boost::system::error_code& ec2,
const dbus::utility::ManagedObjectType& ldapObjects) {
LDAPConfigData confData{};
- if (errorCode)
+ if (ec2)
{
callback(false, confData, ldapType);
- BMCWEB_LOG_ERROR << "D-Bus responses error: " << errorCode;
+ BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec2;
return;
}
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 5fb5aef..a9514ac 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -782,13 +782,13 @@
"xyz.openbmc_project.Network", path,
[ethifaceId{std::string{ethifaceId}},
callback{std::forward<CallbackFunc>(callback)}](
- const boost::system::error_code& errorCode,
+ const boost::system::error_code& ec,
const dbus::utility::ManagedObjectType& resp) {
EthernetInterfaceData ethData{};
std::vector<IPv4AddressData> ipv4Data;
std::vector<IPv6AddressData> ipv6Data;
- if (errorCode)
+ if (ec)
{
callback(false, ethData, ipv4Data, ipv6Data);
return;
@@ -832,13 +832,13 @@
dbus::utility::getManagedObjects(
"xyz.openbmc_project.Network", path,
[callback{std::forward<CallbackFunc>(callback)}](
- const boost::system::error_code& errorCode,
+ const boost::system::error_code& ec,
const dbus::utility::ManagedObjectType& resp) {
// Callback requires vector<string> to retrieve all available
// ethernet interfaces
std::vector<std::string> ifaceList;
ifaceList.reserve(resp.size());
- if (errorCode)
+ if (ec)
{
callback(false, ifaceList);
return;
diff --git a/redfish-core/lib/hypervisor_system.hpp b/redfish-core/lib/hypervisor_system.hpp
index c2580fe..72d02b9 100644
--- a/redfish-core/lib/hypervisor_system.hpp
+++ b/redfish-core/lib/hypervisor_system.hpp
@@ -316,11 +316,11 @@
"xyz.openbmc_project.Settings", path,
[ethIfaceId{std::string{ethIfaceId}},
callback{std::forward<CallbackFunc>(callback)}](
- const boost::system::error_code& error,
+ const boost::system::error_code& ec,
const dbus::utility::ManagedObjectType& resp) {
EthernetInterfaceData ethData{};
std::vector<IPv4AddressData> ipv4Data;
- if (error)
+ if (ec)
{
callback(false, ethData, ipv4Data);
return;
@@ -707,9 +707,9 @@
dbus::utility::getSubTreePaths(
"/xyz/openbmc_project/network/hypervisor", 0, interfaces,
[asyncResp](
- const boost::system::error_code& error,
+ const boost::system::error_code& ec,
const dbus::utility::MapperGetSubTreePathsResponse& ifaceList) {
- if (error)
+ if (ec)
{
messages::resourceNotFound(asyncResp->res, "System", "hypervisor");
return;
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index ce4203b..678ab43 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -818,9 +818,9 @@
std::shared_ptr<task::TaskData> task = task::TaskData::createTask(
[createdObjPath, dumpEntryPath, dumpId, isProgressIntfPresent](
- const boost::system::error_code& err, sdbusplus::message_t& msg,
+ const boost::system::error_code& ec2, sdbusplus::message_t& msg,
const std::shared_ptr<task::TaskData>& taskData) {
- if (err)
+ if (ec2)
{
BMCWEB_LOG_ERROR << createdObjPath.str
<< ": Error in creating dump";
@@ -3599,9 +3599,9 @@
return;
}
std::shared_ptr<task::TaskData> task = task::TaskData::createTask(
- [](const boost::system::error_code& err, sdbusplus::message_t&,
+ [](const boost::system::error_code& ec2, sdbusplus::message_t&,
const std::shared_ptr<task::TaskData>& taskData) {
- if (!err)
+ if (!ec2)
{
taskData->messages.emplace_back(messages::taskCompletedOK(
std::to_string(taskData->index)));
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index 2792dcf..29da308 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -102,12 +102,12 @@
dbus::utility::getManagedObjects(
"xyz.openbmc_project.Network", path,
[callback{std::forward<CallbackFunc>(callback)}](
- const boost::system::error_code& errorCode,
+ const boost::system::error_code& ec,
const dbus::utility::ManagedObjectType& dbusData) {
std::vector<std::string> ntpServers;
std::vector<std::string> domainNames;
- if (errorCode)
+ if (ec)
{
callback(false, ntpServers, domainNames);
return;
@@ -256,12 +256,11 @@
*crow::connections::systemBus, "xyz.openbmc_project.Settings",
"/xyz/openbmc_project/time/sync_method",
"xyz.openbmc_project.Time.Synchronization", "TimeSyncMethod",
- timeSyncMethod,
- [asyncResp](const boost::system::error_code& errorCode) {
- if (errorCode)
- {
- messages::internalError(asyncResp->res);
- }
+ timeSyncMethod, [asyncResp](const boost::system::error_code& ec) {
+ if (ec)
+ {
+ messages::internalError(asyncResp->res);
+ }
});
}
@@ -455,9 +454,9 @@
*crow::connections::systemBus, "xyz.openbmc_project.Settings",
"/xyz/openbmc_project/time/sync_method",
"xyz.openbmc_project.Time.Synchronization", "TimeSyncMethod",
- [asyncResp](const boost::system::error_code& errorCode,
+ [asyncResp](const boost::system::error_code& ec,
const std::string& timeSyncMethod) {
- if (errorCode)
+ if (ec)
{
return;
}
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index 4aaac67..f9063b7 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -144,12 +144,12 @@
using Mapper = dbus::utility::MapperGetSubTreePathsResponse;
auto chassisHandler =
- [sensorAsyncResp](const boost::system::error_code& e,
+ [sensorAsyncResp](const boost::system::error_code& ec2,
const Mapper& chassisPaths) {
- if (e)
+ if (ec2)
{
BMCWEB_LOG_ERROR
- << "Power Limit GetSubTreePaths handler Dbus error " << e;
+ << "Power Limit GetSubTreePaths handler Dbus error " << ec2;
return;
}
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 011e670..b5d0127 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -570,11 +570,11 @@
sensorPath,
[asyncResp, chassisSubNode, sensorTypes,
callback{std::forward<const Callback>(callback)}](
- const boost::system::error_code& e,
+ const boost::system::error_code& ec2,
const dbus::utility::MapperEndPoints& nodeSensorList) {
- if (e)
+ if (ec2)
{
- if (e.value() != EBADR)
+ if (ec2.value() != EBADR)
{
messages::internalError(asyncResp->res);
return;
@@ -1010,9 +1010,9 @@
dbus::utility::getAssociationEndPoints(
path + "/chassis",
[path, owner, sensorsAsyncResp](
- const boost::system::error_code& e,
+ const boost::system::error_code& ec2,
const dbus::utility::MapperEndPoints& endpoints) {
- if (e)
+ if (ec2)
{
return; // if they don't have an association we
// can't tell what chassis is
@@ -1032,9 +1032,9 @@
*crow::connections::systemBus, owner, path,
"xyz.openbmc_project.Control.FanRedundancy",
[path, sensorsAsyncResp](
- const boost::system::error_code& err,
+ const boost::system::error_code& ec3,
const dbus::utility::DBusPropertiesMap& ret) {
- if (err)
+ if (ec3)
{
return; // don't have to have this
// interface
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index 45d5664..28621d5 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -67,11 +67,11 @@
*crow::connections::systemBus, service, objPath,
"xyz.openbmc_project.Software.Activation", "RequestedActivation",
"xyz.openbmc_project.Software.Activation.RequestedActivations.Active",
- [](const boost::system::error_code& errorCode) {
- if (errorCode)
+ [](const boost::system::error_code& ec) {
+ if (ec)
{
- BMCWEB_LOG_DEBUG << "error_code = " << errorCode;
- BMCWEB_LOG_DEBUG << "error msg = " << errorCode.message();
+ BMCWEB_LOG_DEBUG << "error_code = " << ec;
+ BMCWEB_LOG_DEBUG << "error msg = " << ec.message();
}
});
}
@@ -101,14 +101,14 @@
dbus::utility::getDbusObject(
objPath.str, interfaces,
[objPath, asyncResp, payload(std::move(payload))](
- const boost::system::error_code& errorCode,
+ const boost::system::error_code& ec,
const std::vector<
std::pair<std::string, std::vector<std::string>>>&
objInfo) mutable {
- if (errorCode)
+ if (ec)
{
- BMCWEB_LOG_DEBUG << "error_code = " << errorCode;
- BMCWEB_LOG_DEBUG << "error msg = " << errorCode.message();
+ BMCWEB_LOG_DEBUG << "error_code = " << ec;
+ BMCWEB_LOG_DEBUG << "error msg = " << ec.message();
if (asyncResp)
{
messages::internalError(asyncResp->res);
@@ -138,11 +138,11 @@
{
std::shared_ptr<task::TaskData> task =
task::TaskData::createTask(
- [](const boost::system::error_code& ec,
+ [](const boost::system::error_code& ec2,
sdbusplus::message_t& msg,
const std::shared_ptr<task::TaskData>&
taskData) {
- if (ec)
+ if (ec2)
{
return task::completed;
}
@@ -903,9 +903,9 @@
*crow::connections::systemBus, service, path,
"xyz.openbmc_project.Software.Version",
[asyncResp,
- swId](const boost::system::error_code& errorCode,
+ swId](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& propertiesList) {
- if (errorCode)
+ if (ec)
{
messages::internalError(asyncResp->res);
return;