summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/rpc_handler_impl.cc
diff options
context:
space:
mode:
authorConlain Kelly <conlain.k@gmail.com>2018-07-18 11:37:07 -0400
committerConlain Kelly <conlain.k@gmail.com>2018-07-18 11:37:07 -0400
commit5abd722d31f0fa9d50a2f330a60adafc88e90d12 (patch)
treec8c4bf5ef622e8e4a561324c2e279ed99f81a677 /src/components/application_manager/src/rpc_handler_impl.cc
parent81fb6ddaf3ba4ecb5e0129401239af75db45d84d (diff)
parent4f21cbafb247664bd7b89bf2d39944764b1763b1 (diff)
downloadsdl_core-5abd722d31f0fa9d50a2f330a60adafc88e90d12.tar.gz
Merge branch 'develop' into feature/STL_sharedptr_implementation_round2
Diffstat (limited to 'src/components/application_manager/src/rpc_handler_impl.cc')
-rw-r--r--src/components/application_manager/src/rpc_handler_impl.cc22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc
index e6cc0fc849..b374147968 100644
--- a/src/components/application_manager/src/rpc_handler_impl.cc
+++ b/src/components/application_manager/src/rpc_handler_impl.cc
@@ -215,9 +215,12 @@ bool RPCHandlerImpl::ConvertMessageToSO(
message.function_id(),
message.type(),
message.correlation_id());
+
+ rpc::ValidationReport report("RPC");
+
if (!conversion_result ||
!mobile_so_factory().attachSchema(output, true) ||
- ((output.validate() != smart_objects::Errors::OK))) {
+ ((output.validate(&report) != smart_objects::Errors::OK))) {
LOG4CXX_WARN(logger_,
"Failed to parse string to smart object :"
<< message.json_message());
@@ -227,6 +230,9 @@ bool RPCHandlerImpl::ConvertMessageToSO(
message.function_id(),
message.correlation_id(),
mobile_apis::Result::INVALID_DATA));
+
+ (*response)[strings::msg_params][strings::info] =
+ rpc::PrettyFormat(report);
app_manager_.GetRPCService().ManageMobileCommand(
response, commands::Command::SOURCE_SDL);
return false;
@@ -276,8 +282,18 @@ bool RPCHandlerImpl::ConvertMessageToSO(
LOG4CXX_WARN(logger_, "Failed to attach schema to object.");
return false;
}
- if (output.validate() != smart_objects::Errors::OK) {
- LOG4CXX_ERROR(logger_, "Incorrect parameter from HMI");
+
+ rpc::ValidationReport report("RPC");
+
+ if (output.validate(&report) != smart_objects::Errors::OK) {
+ LOG4CXX_ERROR(logger_,
+ "Incorrect parameter from HMI"
+ << rpc::PrettyFormat(report));
+
+ output.erase(strings::msg_params);
+ output[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::INVALID_DATA;
+ output[strings::msg_params][strings::info] = rpc::PrettyFormat(report);
return false;
}
break;