diff --git a/chassis_state_manager.cpp b/chassis_state_manager.cpp
index d78a6f7..f333254 100644
--- a/chassis_state_manager.cpp
+++ b/chassis_state_manager.cpp
@@ -1,4 +1,5 @@
 #include <sdbusplus/bus.hpp>
+#include <sdbusplus/exception.hpp>
 #include <phosphor-logging/log.hpp>
 #include <phosphor-logging/elog-errors.hpp>
 #include "xyz/openbmc_project/Common/error.hpp"
@@ -22,6 +23,7 @@
 namespace server = sdbusplus::xyz::openbmc_project::State::server;
 
 using namespace phosphor::logging;
+using sdbusplus::exception::SdBusError;
 
 constexpr auto CHASSIS_STATE_POWEROFF_TGT = "obmc-chassis-poweroff@0.target";
 constexpr auto CHASSIS_STATE_HARD_POWEROFF_TGT =
@@ -66,7 +68,23 @@
 
     method.append("org.openbmc.control.Power", "pgood");
     auto reply = this->bus.call(method);
-    reply.read(pgood);
+    if (reply.is_method_error())
+    {
+        log<level::ERR>("Error in bus call - could not get initial pgood");
+        goto fail;
+    }
+
+    try
+    {
+        reply.read(pgood);
+    }
+    catch (const SdBusError& e)
+    {
+        log<level::ERR>("Error in bus response - bad encoding of pgood",
+                        entry("ERROR=%s", e.what()),
+                        entry("REPLY_SIG=%s", reply.get_signature()));
+        goto fail;
+    }
 
     if (pgood == 1)
     {
@@ -75,15 +93,15 @@
                                convertForMessage(PowerState::On).c_str()));
         server::Chassis::currentPowerState(PowerState::On);
         server::Chassis::requestedPowerTransition(Transition::On);
+        return;
     }
-    else
-    {
-        log<level::INFO>("Initial Chassis State will be Off",
-                         entry("CHASSIS_CURRENT_POWER_STATE=%s",
-                               convertForMessage(PowerState::Off).c_str()));
-        server::Chassis::currentPowerState(PowerState::Off);
-        server::Chassis::requestedPowerTransition(Transition::Off);
-    }
+
+fail:
+    log<level::INFO>("Initial Chassis State will be Off",
+                     entry("CHASSIS_CURRENT_POWER_STATE=%s",
+                           convertForMessage(PowerState::Off).c_str()));
+    server::Chassis::currentPowerState(PowerState::Off);
+    server::Chassis::requestedPowerTransition(Transition::Off);
 
     return;
 }
@@ -122,7 +140,17 @@
         return false;
     }
 
-    result.read(unitTargetPath);
+    try
+    {
+        result.read(unitTargetPath);
+    }
+    catch (const SdBusError& e)
+    {
+        log<level::ERR>("Error in bus response - bad encoding for GetUnit",
+                        entry("ERROR=%s", e.what()),
+                        entry("REPLY_SIG=%s", result.get_signature()));
+        return false;
+    }
 
     method = this->bus.new_method_call(
         SYSTEMD_SERVICE,
@@ -159,7 +187,17 @@
     std::string newStateResult{};
 
     // Read the msg and populate each variable
-    msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult);
+    try
+    {
+        msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult);
+    }
+    catch (const SdBusError& e)
+    {
+        log<level::ERR>("Error in state change - bad encoding",
+                        entry("ERROR=%s", e.what()),
+                        entry("REPLY_SIG=%s", msg.get_signature()));
+        return 0;
+    }
 
     if ((newStateUnit == CHASSIS_STATE_POWEROFF_TGT) &&
         (newStateResult == "done") && (!stateActive(CHASSIS_STATE_POWERON_TGT)))
