monitor,sensor-monitor: catch exceptions when creating BMC dumps
catch and log exceptions thrown when creating BMC dumps
Signed-off-by: Mike Capps <mikepcapps@gmail.com>
Change-Id: I986ca3e51302016886ca8ae571054a5b4260a093
diff --git a/monitor/power_interface.cpp b/monitor/power_interface.cpp
index 8d9c808..f6589b8 100644
--- a/monitor/power_interface.cpp
+++ b/monitor/power_interface.cpp
@@ -15,6 +15,7 @@
*/
#include "power_interface.hpp"
+#include "logging.hpp"
#include "sdbusplus.hpp"
namespace phosphor::fan::monitor
@@ -45,8 +46,13 @@
std::vector<
std::pair<std::string, std::variant<std::string, uint64_t>>>());
}
- catch (const sdbusplus::exception::exception&)
- {}
+ catch (const std::exception& e)
+ {
+ getLogger().log(
+ fmt::format("Caught exception while creating BMC dump: {}",
+ e.what()),
+ Logger::error);
+ }
}
void PowerInterface::hardPowerOff()