From: Jaemin Ryu Date: Mon, 25 Jun 2018 08:21:40 +0000 (+0900) Subject: Handle unexpected exception during method call X-Git-Tag: submit/tizen_4.0/20180625.090547^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a30ceff4cbf39906298c09b026ed56b85b0f3df;p=platform%2Fcore%2Fsecurity%2Fklay.git Handle unexpected exception during method call Change-Id: Ie86a2df3e5f1570933934d09a867e1925a1cb6d0 Signed-off-by: Jaemin Ryu --- diff --git a/src/rmi/service.cpp b/src/rmi/service.cpp index 22d17a3..ab86f19 100644 --- a/src/rmi/service.cpp +++ b/src/rmi/service.cpp @@ -212,7 +212,13 @@ void Service::onMessageProcess(const std::shared_ptr& 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