Enhance getParsedJson API log
This commit adds the path to JSON to a error log in getParsedJson API.
The path to JSON in the log will help in debugging any failures while
parsing a JSON.
Change-Id: Iafde4d6ff50e191573ec4349d44d8bf70350c5ad
Signed-off-by: Souvik Roy <souvikroyofficial10@gmail.com>
diff --git a/vpd-manager/include/utility/json_utility.hpp b/vpd-manager/include/utility/json_utility.hpp
index 4b44179..4008756 100644
--- a/vpd-manager/include/utility/json_utility.hpp
+++ b/vpd-manager/include/utility/json_utility.hpp
@@ -105,7 +105,8 @@
if (!std::filesystem::exists(pathToJson) ||
std::filesystem::is_empty(pathToJson))
{
- throw std::runtime_error("Incorrect file Path or empty file");
+ throw std::runtime_error(
+ "File does not exist or empty file: [" + pathToJson + "]");
}
std::ifstream l_jsonFile(pathToJson);