Adding severity when reporting an error

Severity is part of the PEL User Header section, and is used
to specify the PEL severity. This commit adds an option to pass
severity parameter while logging PEL. This will help to classify PELs
based on their severity. The commit also maintains uniformity in
the PEL Error logged.

Tested: By creating the error logs(pel) in error scenarios.

Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
Change-Id: Ic084d49b8ffe9aaea2c36c9fefa95a10a9c1c3ec
diff --git a/oem/ibm/requester/dbus_to_file_handler.cpp b/oem/ibm/requester/dbus_to_file_handler.cpp
index 7f15103..35a4d9c 100644
--- a/oem/ibm/requester/dbus_to_file_handler.cpp
+++ b/oem/ibm/requester/dbus_to_file_handler.cpp
@@ -38,7 +38,7 @@
         error(
             "Failed to send resource dump parameters as instance ID DB is not set");
         pldm::utils::reportError(
-            "xyz.openbmc_project.bmc.pldm.InternalFailure");
+            "xyz.openbmc_project.PLDM.Error.sendNewFileAvailableCmd.SendDumpParametersFail");
         return;
     }
     auto instanceId = instanceIdDb->next(mctp_eid);
@@ -88,7 +88,9 @@
 
 void DbusToFileHandler::reportResourceDumpFailure()
 {
-    pldm::utils::reportError("xyz.openbmc_project.bmc.pldm.InternalFailure");
+    pldm::utils::reportError(
+        "xyz.openbmc_project.PLDM.Error.ReportResourceDumpFail",
+        pldm::PelSeverity::Warning);
 
     PropertyValue value{resDumpStatus};
     DBusMapping dbusMapping{resDumpCurrentObjPath, resDumpProgressIntf,
@@ -247,7 +249,7 @@
     {
         error("Failed to send csr to host.");
         pldm::utils::reportError(
-            "xyz.openbmc_project.bmc.pldm.InternalFailure");
+            "xyz.openbmc_project.PLDM.Error.SendFileToHostFail");
         return;
     }
     auto instanceId = instanceIdDb->next(mctp_eid);
@@ -279,7 +281,7 @@
                 "Failed to decode_new_file_resp for vmi, or Host returned error for new_file_available rc = {RC}, cc = {CC}",
                 "RC", rc, "CC", static_cast<unsigned>(completionCode));
             pldm::utils::reportError(
-                "xyz.openbmc_project.bmc.pldm.InternalFailure");
+                "xyz.openbmc_project.PLDM.Error.DecodeNewFileResponseFail");
         }
     };
     rc = handler->registerRequest(
@@ -289,7 +291,7 @@
     {
         error("Failed to send NewFileAvailable Request to Host for vmi");
         pldm::utils::reportError(
-            "xyz.openbmc_project.bmc.pldm.InternalFailure");
+            "xyz.openbmc_project.PLDM.Error.NewFileAvailableRequestFail");
     }
 }