exception: switch to public sdbus exception
SdBusError was intended to be a private error type inside sdbusplus.
Switch all catch locations to use the general sdbusplus::exception type.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I3b5d83511afdf17b2911502279087e57a59b9945
diff --git a/apphandler.cpp b/apphandler.cpp
index f5db550..6f8b2f0 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -114,7 +114,7 @@
objectTree =
ipmi::getAllDbusObjects(*ctx->bus, softwareRoot, redundancyIntf);
}
- catch (sdbusplus::exception::SdBusError& e)
+ catch (sdbusplus::exception::exception& e)
{
log<level::ERR>("Failed to fetch redundancy object from dbus",
entry("INTERFACE=%s", redundancyIntf),
@@ -926,7 +926,7 @@
}
}
}
- catch (sdbusplus::exception::SdBusError& e)
+ catch (sdbusplus::exception::exception& e)
{
log<level::ERR>("Failed to fetch object from dbus",
entry("INTERFACE=%s", session::sessionIntf),
diff --git a/chassishandler.cpp b/chassishandler.cpp
index e04a401..dfbe004 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -1046,7 +1046,7 @@
buttonIntf, "Enabled");
buttonDisabled = !std::get<bool>(enabled);
}
- catch (sdbusplus::exception::SdBusError& e)
+ catch (sdbusplus::exception::exception& e)
{
log<level::ERR>("Fail to get button Enabled property",
entry("PATH=%s", buttonPath.c_str()),
diff --git a/dbus-sdr/sensorcommands.cpp b/dbus-sdr/sensorcommands.cpp
index a2a5b65..7a2cbd0 100644
--- a/dbus-sdr/sensorcommands.cpp
+++ b/dbus-sdr/sensorcommands.cpp
@@ -566,7 +566,7 @@
"Value", ipmi::Value(*value));
// setDbusProperty intended to resolve dbus exception/rc within the
- // function but failed to achieve that. Catch SdBusError in the ipmi
+ // function but failed to achieve that. Catch exception in the ipmi
// callback functions for now (e.g. ipmiSetSensorReading).
if (ec)
{
@@ -607,7 +607,7 @@
boost::system::error_code ec = setDbusProperty(
ctx, connection, path, sensor::vrInterface, "Selected", *vrMode);
// setDbusProperty intended to resolve dbus exception/rc within the
- // function but failed to achieve that. Catch SdBusError in the ipmi
+ // function but failed to achieve that. Catch exception in the ipmi
// callback functions for now (e.g. ipmiSetSensorReading).
if (ec)
{
diff --git a/read_fru_data.cpp b/read_fru_data.cpp
index 740a140..908e54e 100644
--- a/read_fru_data.cpp
+++ b/read_fru_data.cpp
@@ -68,7 +68,7 @@
auto reply = bus.call(method);
reply.read(properties);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
// If property is not found simply return empty value
log<level::ERR>("Error in reading property values",
diff --git a/storagehandler.cpp b/storagehandler.cpp
index 3f09940..eecc18b 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -109,7 +109,7 @@
{
ipmi::sel::readLoggingObjectPaths(cache::paths);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
// No action if reading log objects have failed for this command.
// readLoggingObjectPaths will throw exception if there are no log
@@ -299,7 +299,7 @@
{
ipmi::sel::readLoggingObjectPaths(cache::paths);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
// readLoggingObjectPaths will throw exception if there are no error
// log entries.
@@ -434,7 +434,7 @@
static_cast<uint8_t>(ipmi::sel::eraseComplete));
}
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
return ipmi::responseSuccess(
static_cast<uint8_t>(ipmi::sel::eraseComplete));
diff --git a/transporthandler.cpp b/transporthandler.cpp
index f674865..59096f9 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -318,7 +318,7 @@
ipmi::DELETE_INTERFACE, "Delete");
bus.call_noreply(req);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
if (strcmp(e.name(),
"xyz.openbmc_project.Common.Error.InternalFailure") != 0 &&
diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp
index 5f44818..a0fbcb7 100644
--- a/user_channel/channel_mgmt.cpp
+++ b/user_channel/channel_mgmt.cpp
@@ -623,7 +623,7 @@
return ccUnspecifiedError;
}
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::ERR>("Exception: Network interface does not exist");
return ccInvalidFieldRequest;
@@ -1295,7 +1295,7 @@
auto reply = bus.call(method);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::DEBUG>("set-property failed",
entry("SERVICE=%s", service.c_str()),
@@ -1325,7 +1325,7 @@
auto reply = bus.call(method);
reply.read(value);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::DEBUG>("get-property failed",
entry("SERVICE=%s", service.c_str()),
@@ -1370,7 +1370,7 @@
"exception: Network interface does not exist");
continue;
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::DEBUG>(
"exception: Network interface does not exist");
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index 452be90..6ae90fc 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -162,7 +162,7 @@
method.append(interface, property, value);
bus.call(method);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::ERR>("Failed to set property",
entry("PROPERTY=%s", property.c_str()),
@@ -183,7 +183,7 @@
userMgmtService =
ipmi::getUserService(bus, userMgrInterface, userMgrObjBasePath);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
userMgmtService.clear();
}
@@ -413,7 +413,7 @@
auto reply = bus.call(method);
reply.read(properties);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::DEBUG>(
"Failed to excute method",
@@ -587,7 +587,7 @@
auto reply = bus.call(method);
reply.read(properties);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::ERR>("Failed to excute method",
entry("METHOD=%s", getSubTreeMethod),
@@ -1032,7 +1032,7 @@
deleteUserInterface, deleteUserMethod);
auto reply = bus.call(method);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::DEBUG>("Failed to excute method",
entry("METHOD=%s", deleteUserMethod),
@@ -1056,7 +1056,7 @@
method.append(userName.c_str(), availableGroups, "", false);
auto reply = bus.call(method);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::DEBUG>("Failed to excute method",
entry("METHOD=%s", createUserMethod),
@@ -1080,7 +1080,7 @@
method.append(oldUser.c_str(), userName.c_str());
auto reply = bus.call(method);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::DEBUG>("Failed to excute method",
entry("METHOD=%s", renameUserMethod),
@@ -1530,7 +1530,7 @@
auto reply = bus.call(method);
reply.read(properties);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::DEBUG>("Failed to excute method",
entry("METHOD=%s", getAllPropertiesMethod),
@@ -1671,7 +1671,7 @@
auto reply = bus.call(method);
reply.read(managedObjs);
}
- catch (const sdbusplus::exception::SdBusError& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::DEBUG>("Failed to excute method",
entry("METHOD=%s", getSubTreeMethod),