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/src/pmbus_error.hpp b/phosphor-regulators/src/pmbus_error.hpp
index b589526..1050af3 100644
--- a/phosphor-regulators/src/pmbus_error.hpp
+++ b/phosphor-regulators/src/pmbus_error.hpp
@@ -42,13 +42,37 @@
      * Constructor.
      *
      * @param error error message
+     * @param deviceID unique ID of the device where error occurred
+     * @param inventoryPath inventory path of the device where error occurred
      */
-    explicit PMBusError(const std::string& error) :
-        error{"PMBusError: " + error}
+    explicit PMBusError(const std::string& error, const std::string& deviceID,
+                        const std::string& inventoryPath) :
+        error{"PMBusError: " + error},
+        deviceID{deviceID}, inventoryPath{inventoryPath}
     {
     }
 
     /**
+     * Returns the unique ID of the device where the error occurred.
+     *
+     * @return device ID
+     */
+    const std::string& getDeviceID() const
+    {
+        return deviceID;
+    }
+
+    /**
+     * Returns the inventory path of the device where the error occurred.
+     *
+     * @return inventory path
+     */
+    const std::string& getInventoryPath() const
+    {
+        return inventoryPath;
+    }
+
+    /**
      * Returns the description of this error.
      *
      * @return error description
@@ -63,6 +87,16 @@
      * Error message.
      */
     const std::string error{};
+
+    /**
+     * Unique ID of the device where the error occurred.
+     */
+    const std::string deviceID{};
+
+    /**
+     * Inventory path of the device where the error occurred.
+     */
+    const std::string inventoryPath{};
 };
 
 } // namespace phosphor::power::regulators