in krabs/krabs/filtering/event_filter.hpp [208:233]
inline void event_filter::on_event(const EVENT_RECORD &record, const krabs::trace_context &trace_context) const
{
if (event_callbacks_.empty()) {
return;
}
try
{
if (predicate_ != nullptr && !predicate_(record, trace_context)) {
return;
}
for (auto& callback : event_callbacks_) {
callback(record, trace_context);
}
}
catch (const krabs::could_not_find_schema& ex)
{
// this occurs when a predicate is applied to an event for which
// no schema exists. instead of allowing the exception to halt
// the entire trace, send a notification to the filter's error callback
for (auto& error_callback : error_callbacks_) {
error_callback(record, ex.what());
}
}
}