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>
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);