regulators: Add more info to PMBusError

Add more information to the PMBusError exception:
* Unique ID of the device where the error occurred
* Inventory path of the device where the error occurred

This information is required in order to create an error log entry based
on the exception.

Modify files that currently use PMBusError to adapt to the new
constructor and get methods.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: Iadae82468df3ee46bdd5445f130c43502d454e96
diff --git a/phosphor-regulators/test/pmbus_error_tests.cpp b/phosphor-regulators/test/pmbus_error_tests.cpp
index 670df71..3e455ba 100644
--- a/phosphor-regulators/test/pmbus_error_tests.cpp
+++ b/phosphor-regulators/test/pmbus_error_tests.cpp
@@ -21,14 +21,38 @@
 
 TEST(PMBusErrorTests, Constructor)
 {
-    PMBusError error("VOUT_MODE contains unsupported data format");
+    PMBusError error(
+        "VOUT_MODE contains unsupported data format", "vdd_reg",
+        "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2");
+    EXPECT_EQ(error.getDeviceID(), "vdd_reg");
+    EXPECT_EQ(error.getInventoryPath(),
+              "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2");
     EXPECT_STREQ(error.what(),
                  "PMBusError: VOUT_MODE contains unsupported data format");
 }
 
+TEST(PMBusErrorTests, GetDeviceID)
+{
+    PMBusError error(
+        "VOUT_MODE contains unsupported data format", "vdd_reg",
+        "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2");
+    EXPECT_EQ(error.getDeviceID(), "vdd_reg");
+}
+
+TEST(PMBusErrorTests, GetInventoryPath)
+{
+    PMBusError error(
+        "VOUT_MODE contains unsupported data format", "vdd_reg",
+        "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2");
+    EXPECT_EQ(error.getInventoryPath(),
+              "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2");
+}
+
 TEST(PMBusErrorTests, What)
 {
-    PMBusError error("Unable to convert value to linear data format");
+    PMBusError error(
+        "VOUT_MODE contains unsupported data format", "vdd_reg",
+        "/xyz/openbmc_project/inventory/system/chassis/motherboard/reg2");
     EXPECT_STREQ(error.what(),
-                 "PMBusError: Unable to convert value to linear data format");
+                 "PMBusError: VOUT_MODE contains unsupported data format");
 }