HttpApplication.Error HttpApplication.Error HttpApplication.Error HttpApplication.Error Event

定义

当引发未经处理的异常时发生。Occurs when an unhandled exception is thrown.

public:
 event EventHandler ^ Error;
public event EventHandler Error;
member this.Error : EventHandler 
Public Custom Event Error As EventHandler 

注解

引发的异常Error可通过调用访问事件GetLastError方法。The exception that raises the Error event can be accessed by a call to the GetLastError method. 如果你的应用程序生成自定义错误输出,取消通过调用由 ASP.NET 生成的默认错误消息ClearError方法。If your application generates custom error output, suppress the default error message that is generated by ASP.NET by a call to the ClearError method.

备注

如果 Web 应用程序中包含的 XML Web services,不能使用Error用于这些服务的全局异常处理的事件。If your Web application contains XML Web services, you cannot use the Error event for global exception handling of those services. XML Web services 的 HTTP 处理程序使用的 XML Web 服务中出现,并将其转换为 SOAP 错误之前的任何异常Error被调用。The HTTP handler for XML Web services consumes any exception that occurs in an XML Web service and converts it to a SOAP fault before the Error being called. 若要处理 XML Web 服务异常,生成 SOAP 扩展以处理自定义全局异常处理程序中的 Web 服务异常。To handle XML Web service exceptions, build a SOAP extension to process Web service exceptions in a custom global exception handler.

有关如何处理事件的详细信息,请参阅处理和引发事件For more information about how to handle events, see Handling and Raising Events.

适用于

另请参阅