Interface IEventObserverErrorReporter
- Namespace
- WebDriverBiDi
- Assembly
- WebDriverBiDi.dll
Provides a sink for observer failures that happen after an event handler has already returned control to the caller.
public interface IEventObserverErrorReporter
Remarks
Unlike the library's other interfaces, this one is meant to be implemented: a custom IBiDiModuleHost implements it to receive the failures of observers of the events its modules raise. BiDiDriver implements it already, so an application using the driver needs nothing here.
A failure of this kind cannot be thrown at the code that raised the event, because the handler has already returned: it is the failure of a handler registered with RunHandlerAsynchronously, whose task the dispatcher does not await. Module installs the reporter of the executor it is constructed with on every event it registers, and where the executor does not implement this interface such a failure is observed — so it never surfaces as a UnobservedTaskException — and then discarded.
The reporter is read at the moment a failure is reported rather than captured when an observer is added, so an implementation may return a different callback over time. It should not throw; a failure of the reporter itself has nowhere further to go.
Properties
EventObserverErrorReporter
Gets the callback used to report a late observer execution error.
Func<EventObserverErrorInfo, Task> EventObserverErrorReporter { get; }