mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-11-18 19:04:05 +01:00
Add exception to writer
This commit is contained in:
1 parent
28e1ef79d1
commit
f55d0e1214
1 file changed
+12
-2
@@ -179,8 +179,18 @@ int main (int argc, char *argv[])
|
||||
auto data = received_data.second;
|
||||
|
||||
if (metadata->pulse_id != current_pulse_id) {
|
||||
cout << "ERROR expecting " << current_pulse_id;
|
||||
cout << " diff " << current_pulse_id - metadata->pulse_id << endl;
|
||||
stringstream err_msg;
|
||||
|
||||
using namespace date;
|
||||
using namespace chrono;
|
||||
err_msg << "[" << system_clock::now() << "]";
|
||||
err_msg << "[sf_writer::main]";
|
||||
err_msg << " Read unexpected pulse_id. ";
|
||||
err_msg << " Expected " << current_pulse_id;
|
||||
err_msg << " received " << metadata->pulse_id;
|
||||
err_msg << endl;
|
||||
|
||||
throw runtime_error(err_msg.str());
|
||||
}
|
||||
|
||||
writer.write(metadata, data);
|
||||
|
||||
Reference in new issue
Block a user