[Messaging] Adding Log to get information about open error 12/198412/1
authorLukasz Bardeli <l.bardeli@samsung.com>
Thu, 24 Jan 2019 09:40:40 +0000 (10:40 +0100)
committerLukasz Bardeli <l.bardeli@samsung.com>
Thu, 24 Jan 2019 09:40:40 +0000 (10:40 +0100)
[Verification] Code compiles properly.

Change-Id: I41dcf32e20eea77e1c7f37a7bc3d981baaa2cc32
Signed-off-by: Lukasz Bardeli <l.bardeli@samsung.com>
src/messaging/messaging_util.cc

index 5884f0d45aab0e32f80076f53dc13202b8c05b68..d7e6f32f503aaad2e3a8a3a00b5f44714560ca15 100644 (file)
@@ -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());