Handle unexpected exception during method call 51/182451/1 accepted/tizen/4.0/unified/20180625.200530 submit/tizen_4.0/20180625.090547 submit/tizen_4.0/20180625.090659 submit/tizen_4.0/20180625.091103 submit/tizen_4.0/20180625.091545
authorJaemin Ryu <jm77.ryu@samsung.com>
Mon, 25 Jun 2018 08:21:40 +0000 (17:21 +0900)
committerJaemin Ryu <jm77.ryu@samsung.com>
Mon, 25 Jun 2018 08:21:40 +0000 (17:21 +0900)
Change-Id: Ie86a2df3e5f1570933934d09a867e1925a1cb6d0
Signed-off-by: Jaemin Ryu <jm77.ryu@samsung.com>
src/rmi/service.cpp

index 22d17a3a09dfa672a9b3a3cfc9e84cfb261a8d82..ab86f196ab7acae2d4c8c78ac6965cb1c5f90d20 100644 (file)
@@ -212,7 +212,13 @@ void Service::onMessageProcess(const std::shared_ptr<Connection>& connection)
 
                        connection->send(methodContext->dispatcher(request));
                } catch (runtime::Exception& e) {
-                       connection->send(request.createErrorMessage(e.className(), e.what()));
+                       try {
+                               // Forward the exception to the peer
+                               connection->send(request.createErrorMessage(e.className(), e.what()));
+                       } catch (std::exception& ex) {
+                               // The connection is abnormally closed by the peer.
+                               ERROR(KSINK, ex.what());
+                       }
                } catch (std::exception& e) {
                        try {
                                // Forward the exception to the peer