Processor Client. Process Error Async Event
Performs the tasks needed when an unexpected exception occurs within the operation of the event processor infrastructure. Implementation is mandatory.
This error handler is invoked when there is an exception observed within the EventProcessorClient itself; it is not invoked for exceptions in code that has been implemented to process events or other event handlers and extension points that execute developer code. The EventProcessorClient will make every effort to recover from exceptions and continue processing. Should an exception that cannot be recovered from be encountered, the processor will attempt to forfeit ownership of all partitions that it was processing so that work may be redistributed.
The exceptions surfaced to this method may be fatal or non-fatal; because the processor may not be able to accurately predict whether an exception was fatal or whether its state was corrupted, this method has responsibility for making the determination as to whether processing should be terminated or restarted. The method may do so by calling Stop on the processor instance and then, if desired, calling Start on the processor.
It is recommended that, for production scenarios, the decision be made by considering observations made by this error handler, the method invoked when initializing processing for a partition, and the method invoked when processing for a partition is stopped. Many developers will also include data from their monitoring platforms in this decision as well.
As with event processing, should an exception occur in the code for the error handler, the event processor will allow it to bubble and will not attempt to handle it in any way. Developers are strongly encouraged to take exception scenarios into account and guard against them using try/catch blocks and other means as appropriate.
public event Func<Azure.Messaging.EventHubs.Processor.ProcessErrorEventArgs,System.Threading.Tasks.Task> ProcessErrorAsync;
member this.ProcessErrorAsync : Func<Azure.Messaging.EventHubs.Processor.ProcessErrorEventArgs, System.Threading.Tasks.Task>
Public Custom Event ProcessErrorAsync As Func(Of ProcessErrorEventArgs, Task)