Add handling of the invalid command type
[platform/core/appfw/pkgmgr-info.git] / src / server / request_handler / command_request_handler.cc
index 3cb6b9d..fbe57d0 100644 (file)
@@ -48,6 +48,12 @@ bool CommandRequestHandler::HandleRequest(unsigned char* data, size_t size,
     result_ = std::make_shared<pcp::ResultParcelable>(
         ret, std::vector<pcp::StrArgs>{});
     return true;
+  } else {
+    LOG(ERROR) << "Invalid command type : "
+        << static_cast<int>(parcel->GetCmd());
+    result_ = std::make_shared<pcp::ResultParcelable>(
+        PMINFO_R_ERROR, std::vector<pcp::StrArgs>{});
+    return false;
   }
 
   return true;