Start crashdump when failed in checking property

If system have no objectPath
/xyz/openbmc_project/control/processor_error_config and
/xyz/openbmc_project/control/bmc_reset_disables in dbus
xyz.openbmc_project.Settings, it will directly return and not to
trigger crashdump.

Tested:
Assert IERR and SMI timeout and confirmed the error is logged and
crashdump works as expected.

Signed-off-by: JinFuLin <JeffLin2@quantatw.com>
Change-Id: If640c9f1e346f16ea1ffafe75b377df4004a56c7
diff --git a/include/error_monitors/err2_monitor.hpp b/include/error_monitors/err2_monitor.hpp
index ffa099e..66315d8 100644
--- a/include/error_monitors/err2_monitor.hpp
+++ b/include/error_monitors/err2_monitor.hpp
@@ -39,17 +39,21 @@
         conn->async_method_call(
             [this](boost::system::error_code ec,
                    const std::variant<bool>& property) {
-                if (ec)
+                // Default to no reset after Crashdump
+                bool reset = false;
+                if (!ec)
                 {
-                    return;
+                    const bool* resetPtr = std::get_if<bool>(&property);
+                    if (resetPtr == nullptr)
+                    {
+                        std::cerr << "Unable to read reset on ERR2 value\n";
+                    }
+                    else
+                    {
+                        reset = *resetPtr;
+                    }
                 }
-                const bool* reset = std::get_if<bool>(&property);
-                if (reset == nullptr)
-                {
-                    std::cerr << "Unable to read reset on ERR2 value\n";
-                    return;
-                }
-                startCrashdumpAndRecovery(conn, *reset, "ERR2 Timeout");
+                startCrashdumpAndRecovery(conn, reset, "ERR2 Timeout");
             },
             "xyz.openbmc_project.Settings",
             "/xyz/openbmc_project/control/processor_error_config",
diff --git a/include/error_monitors/ierr_monitor.hpp b/include/error_monitors/ierr_monitor.hpp
index e743177..025f899 100644
--- a/include/error_monitors/ierr_monitor.hpp
+++ b/include/error_monitors/ierr_monitor.hpp
@@ -363,17 +363,21 @@
         conn->async_method_call(
             [this](boost::system::error_code ec,
                    const std::variant<bool>& property) {
-                if (ec)
+                // Default to no reset after Crashdump
+                bool reset = false;
+                if (!ec)
                 {
-                    return;
+                    const bool* resetPtr = std::get_if<bool>(&property);
+                    if (resetPtr == nullptr)
+                    {
+                        std::cerr << "Unable to read reset on CATERR value\n";
+                    }
+                    else
+                    {
+                        reset = *resetPtr;
+                    }
                 }
-                const bool* reset = std::get_if<bool>(&property);
-                if (reset == nullptr)
-                {
-                    std::cerr << "Unable to read reset on CATERR value\n";
-                    return;
-                }
-                startCrashdumpAndRecovery(conn, *reset, "IERR");
+                startCrashdumpAndRecovery(conn, reset, "IERR");
             },
             "xyz.openbmc_project.Settings",
             "/xyz/openbmc_project/control/processor_error_config",
diff --git a/include/error_monitors/smi_monitor.hpp b/include/error_monitors/smi_monitor.hpp
index 5c3d07c..f633b2e 100644
--- a/include/error_monitors/smi_monitor.hpp
+++ b/include/error_monitors/smi_monitor.hpp
@@ -50,21 +50,25 @@
         conn->async_method_call(
             [this](boost::system::error_code ec,
                    const std::variant<bool>& property) {
-                if (ec)
+                // Default to no reset after Crashdump
+                bool reset = false;
+                if (!ec)
                 {
-                    return;
-                }
-                const bool* reset = std::get_if<bool>(&property);
-                if (reset == nullptr)
-                {
-                    std::cerr << "Unable to read reset on " << signalName
-                              << " value\n";
-                    return;
+                    const bool* resetPtr = std::get_if<bool>(&property);
+                    if (resetPtr == nullptr)
+                    {
+                        std::cerr << "Unable to read reset on " << signalName
+                                  << " value\n";
+                    }
+                    else
+                    {
+                        reset = *resetPtr;
+                    }
                 }
 #ifdef HOST_ERROR_CRASHDUMP_ON_SMI_TIMEOUT
-                startCrashdumpAndRecovery(conn, *reset, "SMI Timeout");
+                startCrashdumpAndRecovery(conn, reset, "SMI Timeout");
 #else
-                if (*reset)
+                if (reset)
                 {
                     std::cout << "Recovering the system\n";
                     startWarmReset(conn);