PLDM:Catching exception precisely and printing it

Correcting catch block in PLDM repo to print all
exception precisely so pldm trace can be more
useful to identify defect easily.

Change-Id: If2e86dcb031ddc2e927e7836d7f4359f5b44cdec
Signed-off-by: Kamalkumar Patel <kamalkumar.patel@ibm.com>
diff --git a/libpldmresponder/fru.cpp b/libpldmresponder/fru.cpp
index 2b2dc23..f8cb6d8 100644
--- a/libpldmresponder/fru.cpp
+++ b/libpldmresponder/fru.cpp
@@ -34,7 +34,7 @@
             entity.entity_type = parser.getEntityType(intfMap.first);
             return entity;
         }
-        catch (const std::exception& e)
+        catch (const std::exception&)
         {
             continue;
         }
@@ -161,8 +161,8 @@
     }
     catch (const std::exception& e)
     {
-        error(
-            "Look up of inventory objects failed and PLDM FRU table creation failed");
+        error("Failed building FRU table due to inventory lookup: {ERROR}",
+              "ERROR", e);
         return;
     }
 
@@ -317,7 +317,7 @@
                               std::back_inserter(tlvs));
                 }
             }
-            catch (const std::out_of_range& e)
+            catch (const std::out_of_range&)
             {
                 continue;
             }