ERRORDOCUMENT Section

There are four ways to troubleshoot an error in WebtoB:

  • Displays the error message defined in the source code.

  • Displays the error message defined by the user.

  • Redirect to a local URL.

  • Redirect to an external URL.

For the second, third and fourth cases, the ERRORDOCUMENT section is set to redirect to a specific page for a particular HTTP response status code. All HTTP status codes, except HTTP 401 status code, can be configured.

Configuration Items

The following is the environment configuration format of the ERRORDOCUMENT section.

#"error_document": {
    #"error_document_list": [
        {
            "name": string,
            "status": integer,          # (HTTP status code)
            "url": string
        }
    ]
}

Refer to Types of Setting Values and Configuration Methods for more information on symbols and details of the ERRORDOCUMENT section configuration items.

error_document_list

The following is a list of ERRORDOCUMENT settings.

Item Description

Data Type

Array (object)

error_document_list/name (Required)

The name of the ERRORDOCUMENT setting. This 'name' must be set when using the functionality of the ERRRORDOCUMENT section in other sections.

Item Description

Data Type

String

Range

Up to 31 characters

error_document_list/status (Required)

Specifies the HTTP status code value.

Item Description

Data Type

Integer

Range

100 ~ 599

error_document_list/url (Required)

Specifies a relative path under the doc_root or a full path that the client can interpret.

Item Description

Data Type

String

Range

Up to 255 characters

Example

The following is an example of configuring the ERRORDOCUMENT section:

{
    "error_document": {
        "error_document_list": [
            {
                "name": "forbidden",
                "status": 403,
                "url": "err/403.html"
            },
            {
                "name": "notfound",
                "status": 404,
                "url": "http://tmaxsoft.co.kr/404.html"
            }
        ]
    }
}