From: Pawel Andruszkiewicz
Date: Mon, 25 May 2015 07:25:33 +0000 (+0200)
Subject: [MessagePort] Fixed reporting NotFound errors.
X-Git-Tag: submit/tizen_mobile/20150612.133019^2~2^2~120
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=864877e7c8248e170074d6a497590fd8d7aeb93c;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[MessagePort] Fixed reporting NotFound errors.
[Verification] Following TCT test pass:
MessagePortManager_requestRemoteMessagePort_TypeMismatch
MessagePortManager_requestTrustedRemoteMessagePort_TypeMismatch
Change-Id: I470a58fc45bb1cad87d5eb20bc38abf4a61f9a98
Signed-off-by: Pawel Andruszkiewicz
---
diff --git a/src/messageport/messageport_instance.cc b/src/messageport/messageport_instance.cc
index 0142928d..f4a9bc37 100644
--- a/src/messageport/messageport_instance.cc
+++ b/src/messageport/messageport_instance.cc
@@ -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(