Throw exception for errors in EnrolleeSecurity::performOwnershipTransfer() 72/211872/2
authorSenthil Kumar G S <senthil.gs@samsung.com>
Tue, 30 Jul 2019 10:40:46 +0000 (16:10 +0530)
committerSudipto Bal <sudipto.bal@samsung.com>
Fri, 9 Aug 2019 12:55:27 +0000 (12:55 +0000)
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 <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp

index 03689cf..a369978 100755 (executable)
@@ -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<std::mutex> lck(m_mtx);