A schema lookup occurs when a predicate filter is applied to a record. If the schema lookup fails, a krabs::could_not_find_schema exception is thrown. This exception was previously unhandled and caused an exception to propagate on the main trace thread.
A better way to handle this is to catch the schema exception and notify the application via an OnError delegate. An OnError delegate existed on the C++/CLI Provider object but not on the native event_filter and provider objects nor on the C++/CLI EventFilter.
This change finishes the implementation of error handling on the managed and native layers:
it adds an OnError delegate to the C++/CLI EventFilter class, wires it up to a new callback in event_filter, and adds an appropriate try/catch in event_filter::on_event to use the new callback
it wires up the existing OnError delegate on the C++/CLI Provider to a new callback in provider and adds an appropriate try/catch in base_provider::on_event to use the new callback
it adds an interface for EventRecordError to allow OnError handlers to be unit-tested
A schema lookup occurs when a predicate filter is applied to a record. If the schema lookup fails, a
krabs::could_not_find_schema
exception is thrown. This exception was previously unhandled and caused an exception to propagate on the main trace thread.A better way to handle this is to catch the schema exception and notify the application via an
OnError
delegate. AnOnError
delegate existed on the C++/CLIProvider
object but not on the nativeevent_filter
andprovider
objects nor on the C++/CLIEventFilter
.This change finishes the implementation of error handling on the managed and native layers:
OnError
delegate to the C++/CLIEventFilter
class, wires it up to a new callback inevent_filter
, and adds an appropriatetry
/catch
inevent_filter::on_event
to use the new callbackOnError
delegate on the C++/CLIProvider
to a new callback inprovider
and adds an appropriatetry
/catch
inbase_provider::on_event
to use the new callback