Table of Contents

Interface IEventObserverErrorReporter

Namespace
WebDriverBiDi
Assembly
WebDriverBiDi.dll

Provides a sink for the failures of observable event observers.

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.

Every observer failure is reported here rather than thrown at the code that raised the event: a synchronously-run handler's as it happens, and the failure of a handler registered with RunHandlerAsynchronously, whose task the dispatcher does not await, after the handler has returned. Module installs the reporter of the executor it is constructed with on every event it registers. Where the executor does not implement this interface, a synchronously-run handler's failure propagates to the code that raised the event, and an asynchronously-run handler's 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; }

Property Value

Func<EventObserverErrorInfo, Task>