diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/components/application_manager/src/rpc_handler_impl.cc | 22 |
2 files changed, 20 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 51029d8c7b..1a180b6cf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,7 +235,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}) set(ARCHIVE_OUTPUT_DIRECTORY ./bin) -set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wno-deprecated-declarations -Wuninitialized -Wvla") +set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wall -Werror -Wuninitialized -Wvla") if (USE_GOLD_LD) execute_process(COMMAND ld -v OUTPUT_VARIABLE result) diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc index 42894a36a8..2ee7a23707 100644 --- a/src/components/application_manager/src/rpc_handler_impl.cc +++ b/src/components/application_manager/src/rpc_handler_impl.cc @@ -214,9 +214,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()); @@ -226,6 +229,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; @@ -275,8 +281,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; |