Throw the exception on the EM D-Bus fail
Throw the exception that occurs when there is a D-Bus failure when
trying to talk to entity-manager instead of the name of the exception,
and also add a trace that says entity-manager is the culprit.
Nothing was actually printing the exception name on the crash, it would
just have: terminate called after throwing an instance of 'char const*'
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I91eb65468a9a799bcd7256aae24a1121164b59b9
diff --git a/virtualSensor.cpp b/virtualSensor.cpp
index 4588e5b..5e4ca5f 100644
--- a/virtualSensor.cpp
+++ b/virtualSensor.cpp
@@ -653,7 +653,8 @@
if (std::string("org.freedesktop.DBus.Error.ServiceUnknown") !=
ex.name())
{
- throw ex.name();
+ error("Could not reach entity-manager: {ERROR}", "ERROR", ex);
+ throw;
}
}