Commit 9c1a3004 authored by Alessio Netti's avatar Alessio Netti
Browse files

Analytics: Aggregator now throw an exception when computing fails

parent 09ffcaaa
......@@ -50,10 +50,8 @@ void AggregatorAnalyzer::compute(U_Ptr unit) {
// Since we do not clear the internal buffer, all sensor readings will be accumulated in the same vector
elCtr = _buffer==nullptr ? 0 : _buffer->size();
_buffer = _queryEngine.querySensor(in->getName(), _window, 0, _buffer);
if(!_buffer || _buffer->size()<=elCtr) {
LOG(debug) << "Analyzer " << _name << " cannot read from sensor " << in->getName() << "!";
return;
}
if(!_buffer || _buffer->size()<=elCtr)
throw std::runtime_error("Analyzer " + _name + ": cannot read from sensor " + in->getName() + "!");
}
compute_internal(unit, _buffer);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment