From 812a121c5a2b95a8bc7d3e69e1fabac10b6001f2 Mon Sep 17 00:00:00 2001 From: Senthil Kumar G S Date: Tue, 30 Jul 2019 16:10:46 +0530 Subject: [PATCH] Throw exception for errors in EnrolleeSecurity::performOwnershipTransfer() Current: Returning ES_ERROR for all error cases doesn't let the caller know what went wrong, Proposed: Throw ESPlatformException with the actual OCStackResult for all error cases. https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/551/commits/d7bf5d91b812d1cd3a62ab7d51e33d8101cf27a7 (cherry-picked from d7bf5d91b812d1cd3a62ab7d51e33d8101cf27a7) Change-Id: I4b8f39a4dc749f2393908a02df68df251fded24c Signed-off-by: Senthil Kumar G S Signed-off-by: Sudipto --- service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp b/service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp index 03689cf..a369978 100755 --- a/service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp +++ b/service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp @@ -976,7 +976,7 @@ namespace OIC if (result != OC_STACK_OK) { OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "doOwnershipTransfer is failed"); - return ESResult::ES_ERROR; + throw ESPlatformException(result); } std::unique_lock lck(m_mtx); -- 2.7.4