From 599cbf5928d467fb63108993c1aeced1251df13c Mon Sep 17 00:00:00 2001 From: Lukasz Bardeli Date: Thu, 24 Jan 2019 10:40:40 +0100 Subject: [PATCH] [Messaging] Adding Log to get information about open error [Verification] Code compiles properly. Change-Id: I41dcf32e20eea77e1c7f37a7bc3d981baaa2cc32 Signed-off-by: Lukasz Bardeli --- src/messaging/messaging_util.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/messaging/messaging_util.cc b/src/messaging/messaging_util.cc index 5884f0d4..d7e6f32f 100644 --- a/src/messaging/messaging_util.cc +++ b/src/messaging/messaging_util.cc @@ -36,6 +36,7 @@ #include "common/logger.h" #include "common/platform_exception.h" #include "common/scope_exit.h" +#include "common/tools.h" #include "tizen/tizen.h" using common::ErrorCode; @@ -271,6 +272,7 @@ PlatformResult MessagingUtil::loadFileContentToString(const std::string& file_pa std::string* result) { ScopeLogger(); std::ifstream input_file; + input_file.open(file_path, std::ios::in); if (input_file.is_open()) { @@ -284,6 +286,7 @@ PlatformResult MessagingUtil::loadFileContentToString(const std::string& file_pa input_file.close(); *result = ConvertToUtf8(file_path, outString); } else { + LoggerW("open() error: %s", common::tools::GetErrorString(errno).c_str()); std::stringstream ss_error_msg; ss_error_msg << "Failed to open file: " << file_path; return LogAndCreateResult(ErrorCode::IO_ERR, ss_error_msg.str().c_str()); -- 2.34.1