diff options
author | kush.agrawal@samsung.com <kush.agrawal@samsung.com> | 2019-11-11 12:33:33 +0530 |
---|---|---|
committer | Sudipto Bal <sudipto.bal@samsung.com> | 2019-11-18 11:41:14 +0900 |
commit | cae47ec6b9da52379fa308443dadd9759b79346e (patch) | |
tree | f3a95a5922eb462df1fb5e6fa74af82109e28563 | |
parent | a836faa80f9b904ec25fba54fc6f015ff1041c23 (diff) | |
download | iotivity-cae47ec6b9da52379fa308443dadd9759b79346e.tar.gz iotivity-cae47ec6b9da52379fa308443dadd9759b79346e.tar.bz2 iotivity-cae47ec6b9da52379fa308443dadd9759b79346e.zip |
Added missing catch block for std::exception (#598)
* [CONPRO-1523]Added missing catch block for std::exception
This exception is thrown when thread execution fails
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/598/commits/2a57dc73fe7dc0d0c9fdf7b93ec3e4ac1974d9f2
(cherry-picked from 2a57dc73fe7dc0d0c9fdf7b93ec3e4ac1974d9f2)
Signed-off-by: Kush <kush.agrawal@samsung.com>
* Removed extra space
Change-Id: Ic45c377796668dce5ad417d89c17624267d21a33
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
-rwxr-xr-x | resource/src/InProcClientWrapper.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/resource/src/InProcClientWrapper.cpp b/resource/src/InProcClientWrapper.cpp index 132d082d5..433d84008 100755 --- a/resource/src/InProcClientWrapper.cpp +++ b/resource/src/InProcClientWrapper.cpp @@ -962,15 +962,21 @@ namespace OC try { rep = parseGetSetCallback(clientResponse); + OIC_LOG_V(DEBUG, TAG, "%s: call response callback", __func__); + std::thread exec(context->callback, serverHeaderOptions, rep, result); + exec.detach(); } catch(OC::OCException& e) { - result = e.code(); + oclog() << "Exception in parseGetSetCallback, ignoring callback: " + << e.what() << std::flush; + } + catch(const std::exception& e) + { + oclog() << "Exception in thread execution, ignoring callback: " + << e.what() << std::flush; } - OIC_LOG_V(DEBUG, TAG, "%s: call response callback", __func__); - std::thread exec(context->callback, serverHeaderOptions, rep, result); - exec.detach(); return OC_STACK_DELETE_TRANSACTION; } |