zoukankan      html  css  js  c++  java
  • HTTP Errors <httpErrors>

    HTTP Errors <httpErrors>

    errorMode Optional enum attribute.

    Specifies whether HTTP errors are enabled.

    The errorMode attribute can be one of the following values; the default is DetailedLocalOnly.
    Table 4
    ValueDescription
    DetailedLocalOnly Returns detailed error information if the request is from the local computer, and returns a custom error message if the request is from an external computer.

    The numeric value is 0.
    Custom Replaces the error that the module or server generates with a custom page that you specify. This mode is useful in providing friendlier error messages to end users.

    Note: This setting turns off detailed errors, even for local requests.

    The numeric value is 1.
    Detailed Sends detailed error information back to the client. This mode is useful for testing and debugging Web sites and applications.

    The numeric value is 2.
    existingResponse Optional enum attribute.

    Specifies what happens to an existing response when the HTTP status code is an error, i.e. response codes >= 400.

    The existingResponse attribute can be one of the following values; the default is Auto.
    Table 5
    ValueDescription
    Auto Leaves the response untouched only if the SetStatus flag is set.

    The numeric value is 0.
    Replace Replaces the existing response even if the SetStatus flag is set.

    The numeric value is 1.
    PassThrough Leaves the response untouched if an existing response exists.

    The numeric value is 2.

    HttpErrorsSection Class

    The following table lists the possible values for the ErrorMode property. The default is 0 (DetailedLocalOnly).

    Table 4
    ValueKeywordDescription
    0 DetailedLocalOnly A detailed error response is generated only if the request comes from the local computer. If the request comes from an external address, the server generates a custom error response. Note: The value of the ExistingResponse property determines whether a detailed or custom error is generated.
    1 Custom The error that the module or server generates is replaced by a custom page that you specify. This mode is useful in providing friendlier error messages to end users. Note: This setting turns off detailed errors, even for local requests.
    2 Detailed A page with detailed information about the application error is displayed, and custom errors are not shown. This mode is useful for testing and debugging Web sites and applications. Note: It is a security risk to set ErrorMode to Detailed, because even remote clients will receive detailed error information that could lead to unwanted information disclosure.

    The following table lists the possible values for the ExistingResponse property. The default is 0 (Auto).

    Table 5
    ValueKeywordDescription
    0 Auto The response depends on the first successful match of the following set of ordered conditions:

    1. If the IHttpResponse::SetStatus method was called by using the fTrySkipCustomErrors flag, the existing response is passed through, and no detailed or custom error is shown.
    2. If the ErrorMode property is set to Custom, the response is replaced.
    3. If ErrorMode is set to Detailed and there is an existing response, the response is passed through.
    4. If ErrorMode is set to Detailed and there is no existing response, the response is replaced with a detailed error.
    1 Replace The existing response is always replaced, regardless of how SetStatus was called.
    2 PassThrough The existing response is always used.
  • 相关阅读:
    [翻译]ASP.NET MVC 3 开发的20个秘诀(六)[20 Recipes for Programming MVC 3]:找回忘记的密码
    No.9425 [翻译]开发之前设计先行
    [翻译]ASP.NET MVC 3 开发的20个秘诀(五)[20 Recipes for Programming MVC 3]:发送欢迎邮件
    内联(inline)函数与虚函数(virtual)的讨论
    内联函数、模板、头文件杂记(转)
    gdb使用整理
    data structure and algorithm analysis上一点摘录
    lsof by example 例子
    linux core文件机制
    转一篇shared_ptr的小文
  • 原文地址:https://www.cnblogs.com/chucklu/p/14441768.html
Copyright © 2011-2022 走看看