From f19bc8880a174558293d9dd4e4f11ebeda310abe Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Tue, 17 Nov 2020 13:34:51 +0100 Subject: [PATCH] handling start acq call back exception --- slsReceiverSoftware/src/Implementation.cpp | 13 +++++++++---- slsReceiverSoftware/src/ReceiverApp2.cpp | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/slsReceiverSoftware/src/Implementation.cpp b/slsReceiverSoftware/src/Implementation.cpp index 711576688..d1a880b3f 100644 --- a/slsReceiverSoftware/src/Implementation.cpp +++ b/slsReceiverSoftware/src/Implementation.cpp @@ -497,10 +497,15 @@ void Implementation::startReceiver() { // callbacks if (startAcquisitionCallBack) { - startAcquisitionCallBack(filePath, fileName, fileIndex, - (generalData->imageSize) + - (generalData->fifoBufferHeaderSize), - pStartAcquisition); + try { + startAcquisitionCallBack(filePath, fileName, fileIndex, + (generalData->imageSize) + + (generalData->fifoBufferHeaderSize), + pStartAcquisition); + } catch (const std::exception &e) { + throw sls::RuntimeError("Start Acquisition Callback Error: " + + std::string(e.what())); + } if (rawDataReadyCallBack != nullptr) { LOG(logINFO) << "Data Write has been defined externally"; } diff --git a/slsReceiverSoftware/src/ReceiverApp2.cpp b/slsReceiverSoftware/src/ReceiverApp2.cpp index 75ef4f749..8b3e10327 100644 --- a/slsReceiverSoftware/src/ReceiverApp2.cpp +++ b/slsReceiverSoftware/src/ReceiverApp2.cpp @@ -28,7 +28,8 @@ int StartAcq(std::string filepath, std::string filename, uint64_t fileindex, << " filename:" << filename << " fileindex:" << fileindex << " datasize:" << datasize << " ####"; - throw std::runtime_error("start acquisition call back error"); + throw std::runtime_error( + "Throwing exception from start acquisition call back"); return 0; }