summaryrefslogtreecommitdiffstats
path: root/elog_watch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'elog_watch.cpp')
-rw-r--r--elog_watch.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/elog_watch.cpp b/elog_watch.cpp
index 6cb7a0f..e2a3866 100644
--- a/elog_watch.cpp
+++ b/elog_watch.cpp
@@ -1,5 +1,6 @@
#include <cereal/cereal.hpp>
#include <phosphor-logging/elog.hpp>
+#include <sdbusplus/exception.hpp>
#include "elog_watch.hpp"
#include "dump_internal.hpp"
@@ -65,7 +66,17 @@ void Watch::addCallback(sdbusplus::message::message& msg)
sdbusplus::xyz::openbmc_project::Dump::Create::Error::QuotaExceeded;
LogEntryMsg logEntry;
- msg.read(logEntry);
+ try
+ {
+ msg.read(logEntry);
+ }
+ catch (const sdbusplus::exception::SdBusError& e)
+ {
+ log<level::ERR>("Failed to parse elog add signal",
+ entry("ERROR=%s", e.what()),
+ entry("REPLY_SIG=%s", msg.get_signature()));
+ return;
+ }
std::string objectPath(std::move(logEntry.first));
@@ -135,7 +146,17 @@ void Watch::addCallback(sdbusplus::message::message& msg)
void Watch::delCallback(sdbusplus::message::message& msg)
{
sdbusplus::message::object_path logEntry;
- msg.read(logEntry);
+ try
+ {
+ msg.read(logEntry);
+ }
+ catch (const sdbusplus::exception::SdBusError& e)
+ {
+ log<level::ERR>("Failed to parse elog del signal",
+ entry("ERROR=%s", e.what()),
+ entry("REPLY_SIG=%s", msg.get_signature()));
+ return;
+ }
//Get elog entry message string.
std::string objectPath(logEntry);
OpenPOWER on IntegriCloud