handling acquisition finished callback exception

This commit is contained in:
maliakal_d 2020-11-17 13:38:22 +01:00
parent f19bc8880a
commit a36a294515
2 changed files with 15 additions and 5 deletions

View File

@ -599,9 +599,16 @@ void Implementation::stopReceiver() {
LOG(logINFORED) << "Deactivated Receiver"; LOG(logINFORED) << "Deactivated Receiver";
} }
// callback // callback
if (acquisitionFinishedCallBack) if (acquisitionFinishedCallBack) {
acquisitionFinishedCallBack((tot / numThreads), try {
pAcquisitionFinished); acquisitionFinishedCallBack((tot / numThreads),
pAcquisitionFinished);
} catch (const std::exception &e) {
throw sls::RuntimeError(
"Acquisition Finished Callback Error: " +
std::string(e.what()));
}
}
} }
// change status // change status

View File

@ -28,8 +28,8 @@ int StartAcq(std::string filepath, std::string filename, uint64_t fileindex,
<< " filename:" << filename << " fileindex:" << fileindex << " filename:" << filename << " fileindex:" << fileindex
<< " datasize:" << datasize << " ####"; << " datasize:" << datasize << " ####";
throw std::runtime_error( /*throw std::runtime_error(
"Throwing exception from start acquisition call back"); "Throwing exception from start acquisition call back");*/
return 0; return 0;
} }
@ -40,6 +40,9 @@ int StartAcq(std::string filepath, std::string filename, uint64_t fileindex,
*/ */
void AcquisitionFinished(uint64_t frames, void *p) { void AcquisitionFinished(uint64_t frames, void *p) {
std::cout << "#### AcquisitionFinished: frames:" << frames << " ####"; std::cout << "#### AcquisitionFinished: frames:" << frames << " ####";
throw std::runtime_error(
"Throwing exception from acquisition finished call back");
} }
/** /**