你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

EventProcessorOptions.SetExceptionHandler 方法

定义

设置接收常规异常通知的处理程序。

处理来自特定事件中心分区的事件时发生的异常将传递到该分区的事件处理器的 onError 方法。 当没有与引发活动关联的事件处理器,或者无法创建事件处理器时,将调用此处理程序。

public void SetExceptionHandler (Action<Microsoft.Azure.EventHubs.Processor.ExceptionReceivedEventArgs> exceptionHandler);
member this.SetExceptionHandler : Action<Microsoft.Azure.EventHubs.Processor.ExceptionReceivedEventArgs> -> unit
Public Sub SetExceptionHandler (exceptionHandler As Action(Of ExceptionReceivedEventArgs))

参数

exceptionHandler
Action<ExceptionReceivedEventArgs>

发生异常时调用的处理程序。 设置为 null 可停止处理。

适用于