From: Lukasz Bardeli Date: Thu, 24 Jan 2019 09:40:40 +0000 (+0100) Subject: [Messaging] Adding Log to get information about open error X-Git-Tag: submit/tizen_5.0/20190130.120958~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=599cbf5928d467fb63108993c1aeced1251df13c;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Messaging] Adding Log to get information about open error [Verification] Code compiles properly. Change-Id: I41dcf32e20eea77e1c7f37a7bc3d981baaa2cc32 Signed-off-by: Lukasz Bardeli --- 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());