Fix pluginCheck in service logic 73/35373/1
authorZofia Abramowska <z.abramowska@samsung.com>
Thu, 12 Feb 2015 16:39:21 +0000 (17:39 +0100)
committerZofia Abramowska <z.abramowska@samsung.com>
Thu, 12 Feb 2015 16:39:21 +0000 (17:39 +0100)
Change-Id: I835c471b38756a9d3cee1ddfe4c4b90591744aa4

src/service/logic/Logic.cpp

index 95656e5..e92808e 100644 (file)
@@ -210,8 +210,9 @@ bool Logic::pluginCheck(const RequestContextPtr &context, const PolicyKey &key,
 
     ServicePluginInterfacePtr servicePlugin =
             std::dynamic_pointer_cast<ServicePluginInterface>(plugin);
-    if (!plugin) {
-        throw PluginNotFoundException(result);
+    if (!servicePlugin) {
+        result = PolicyResult(PredefinedPolicyType::DENY);
+        return true;
     }
 
     AgentType requiredAgent;
@@ -243,7 +244,8 @@ bool Logic::pluginCheck(const RequestContextPtr &context, const PolicyKey &key,
             }
             return false;
         default:
-            throw PluginErrorException(key); // This 'throw' should be removed or handled properly.
+            result = PolicyResult(PredefinedPolicyType::DENY);
+            return true;
     }
 }