From ef8d727ca0eb346af951d15d84ba6f2b9564adf5 Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Wed, 23 Apr 2014 20:34:14 +0200 Subject: [remote-processor] Add context information on failure BZ: 190038 Remote processor was not displaying information in case of network read/write error. Add some error messages to ease debug. Change-Id: I465062e8cf77f94b3d4d4d0c71338c4630aac276 Signed-off-by: Kevin Rocard Signed-off-by: Mattijs Korpershoek --- remote-process/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'remote-process') diff --git a/remote-process/main.cpp b/remote-process/main.cpp index 2daa055..85514ca 100644 --- a/remote-process/main.cpp +++ b/remote-process/main.cpp @@ -98,17 +98,19 @@ public: bool sendAndDisplayCommand(CConnectionSocket &connectionSocket, CRequestMessage &requestMessage) { - if (!requestMessage.serialize(&connectionSocket, true)) { + string strError; + + if (!requestMessage.serialize(&connectionSocket, true, strError)) { - cerr << "Unable to send command to target" << endl; + cerr << "Unable to send command to target: " << strError << endl; return false; } ///// Get answer CAnswerMessage answerMessage; - if (!answerMessage.serialize(&connectionSocket, false)) { + if (!answerMessage.serialize(&connectionSocket, false, strError)) { - cerr << "No answer received from target" << endl; + cerr << "Unable to received answer from target: " << strError << endl; return false; } -- cgit v1.1