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/actions/pmbus_write_vout_command_action.cpp b/phosphor-regulators/src/actions/pmbus_write_vout_command_action.cpp
index 2a245a9..9e02746 100644
--- a/phosphor-regulators/src/actions/pmbus_write_vout_command_action.cpp
+++ b/phosphor-regulators/src/actions/pmbus_write_vout_command_action.cpp
@@ -38,7 +38,7 @@
         i2c::I2CInterface& interface = getI2CInterface(environment);
 
         // Get exponent value for converting volts value to linear format
-        int8_t exponentValue = getExponentValue(interface);
+        int8_t exponentValue = getExponentValue(environment, interface);
 
         // Convert volts value to linear data format
         uint16_t linearValue =
@@ -92,8 +92,8 @@
     return ss.str();
 }
 
-int8_t
-    PMBusWriteVoutCommandAction::getExponentValue(i2c::I2CInterface& interface)
+int8_t PMBusWriteVoutCommandAction::getExponentValue(
+    ActionEnvironment& environment, i2c::I2CInterface& interface)
 {
     // Check if an exponent value is defined for this action
     if (exponent.has_value())
@@ -113,7 +113,9 @@
     // Verify format is linear; other formats not currently supported
     if (format != pmbus_utils::VoutDataFormat::linear)
     {
-        throw PMBusError("VOUT_MODE contains unsupported data format");
+        throw PMBusError("VOUT_MODE contains unsupported data format",
+                         environment.getDeviceID(),
+                         environment.getDevice().getFRU());
     }
 
     // Return parameter value; it contains the exponent when format is linear