cleanup: drop obsolete is_method_error checks
is_method_error is obsolete from sdbusplus.
Change-Id: Ia3fb76dd2f4a14eca51b3cfbcd50427b36d946b3
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp
index 067efc7..9cf8177 100644
--- a/dbus/dbusconfiguration.cpp
+++ b/dbus/dbusconfiguration.cpp
@@ -182,10 +182,6 @@
try
{
auto resp = bus.call(mapper);
- if (resp.is_method_error())
- {
- throw std::runtime_error("ObjectMapper Call Failure");
- }
resp.read(respData);
}
catch (sdbusplus::exception_t&)
@@ -249,11 +245,6 @@
try
{
auto responce = bus.call(endpoint);
- if (responce.is_method_error())
- {
- throw std::runtime_error("Error getting managed objects from " +
- owner.first);
- }
responce.read(configuration);
}
catch (sdbusplus::exception_t&)
diff --git a/dbus/util.cpp b/dbus/util.cpp
index 3e3597b..733aff4 100644
--- a/dbus/util.cpp
+++ b/dbus/util.cpp
@@ -117,10 +117,7 @@
try
{
auto msg = bus.call(critical);
- if (!msg.is_method_error())
- {
- msg.read(criticalMap);
- }
+ msg.read(criticalMap);
}
catch (sdbusplus::exception_t&)
{
diff --git a/setsensor.cpp b/setsensor.cpp
index a60778f..3681996 100644
--- a/setsensor.cpp
+++ b/setsensor.cpp
@@ -36,15 +36,15 @@
pimMsg.append(sproperty);
pimMsg.append(v);
- auto responseMsg = PropertyWriteBus.call(pimMsg);
- if (responseMsg.is_method_error())
+ try
+ {
+ auto responseMsg = PropertyWriteBus.call(pimMsg);
+ fprintf(stderr, "call to Set the host sensor value succeeded.\n");
+ }
+ catch (const sdbusplus::exception::SdBusError& ex)
{
fprintf(stderr, "call to Set the host sensor value failed.\n");
}
- else
- {
- fprintf(stderr, "call to Set the host sensor value succeeded.\n");
- }
}
static std::string GetControlPath(int8_t zone)
@@ -69,15 +69,15 @@
pimMsg.append(property);
pimMsg.append(v);
- auto responseMsg = PropertyWriteBus.call(pimMsg);
- if (responseMsg.is_method_error())
+ try
+ {
+ auto responseMsg = PropertyWriteBus.call(pimMsg);
+ fprintf(stderr, "call to Set the manual mode succeeded.\n");
+ }
+ catch (const sdbusplus::exception::SdBusError& ex)
{
fprintf(stderr, "call to Set the manual mode failed.\n");
}
- else
- {
- fprintf(stderr, "call to Set the manual mode succeeded.\n");
- }
}
int main(int argc, char* argv[])