[MessagePort] Fixed reporting NotFound errors.
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Mon, 25 May 2015 07:25:33 +0000 (09:25 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Thu, 28 May 2015 07:07:08 +0000 (16:07 +0900)
[Verification] Following TCT test pass:
MessagePortManager_requestRemoteMessagePort_TypeMismatch
MessagePortManager_requestTrustedRemoteMessagePort_TypeMismatch

Change-Id: I470a58fc45bb1cad87d5eb20bc38abf4a61f9a98
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
src/messageport/messageport_instance.cc

index 0142928d90161e4a8bf554cd464d8f5a81623271..f4a9bc376bfdd98888f3a530946b5680e44dfb42 100644 (file)
@@ -181,6 +181,7 @@ void MessageportInstance::
 
   LoggerD("Checking remote port of %s: %s", remoteMessagePortName.c_str(),
     portCheck ? "true" : "false");
+  LoggerD("Error code: -0x%X", -ret);
 
   if (ret == MESSAGE_PORT_ERROR_NONE) {
     if (portCheck)  {
@@ -201,6 +202,10 @@ void MessageportInstance::
     ReportError(
         NotFoundException("The port of the target application is not found"),
         out);
+  } else if (ret == MESSAGE_PORT_ERROR_PORT_NOT_FOUND) {
+    ReportError(
+        NotFoundException("The port of the target application is not found"),
+        out);
   } else {
     ReportError(UnknownException("Unknown Error"), out);
   }
@@ -221,8 +226,9 @@ void MessageportInstance::
   ret = message_port_check_trusted_remote_port
         (appId.c_str(), remoteMessagePortName.c_str(), &portCheck);
 
-  LoggerD("Checking trusted remoteport of %s:%s",
+  LoggerD("Checking trusted remote port of %s: %s",
     remoteMessagePortName.c_str(), portCheck ? "true":"false");
+  LoggerD("Error code: -0x%X", -ret);
 
   if (ret == MESSAGE_PORT_ERROR_NONE) {
     if (portCheck) {
@@ -243,6 +249,10 @@ void MessageportInstance::
     ReportError(
         NotFoundException("The port of the target application is not found"),
         out);
+  } else if (ret == MESSAGE_PORT_ERROR_PORT_NOT_FOUND) {
+    ReportError(
+        NotFoundException("The port of the target application is not found"),
+        out);
   } else if (ret == MESSAGE_PORT_ERROR_CERTIFICATE_NOT_MATCH) {
     ReportError(
         UnknownException(