FaultDocument

The FaultDocument directive, whose characteristics are listed in the following table, specifies what the mod_ jadehttp module does when it encounters an error.

Characteristic Value
Action Specifies the URL or path name for redirection when an error occurs
Syntax FaultDocument cause redirect-url
Context Location
Handler jadehttp-handler, jadehttp-info
Module mod_jadehttp
Example 1 FaultDocument TcpConnectFailed http://secondary.example.com:80/page.html
Example 2 FaultDocument PostTooLarge bigpost.html

You can specify the cause value in numeric or text form. Valid values for the cause are listed in the following table.

Numeric Name Text Name
600 TcpConnectFailed
601 PostTooLarge
602 ServiceFailed
603 DataReadFailed

You must specify a valid URL or path name for the redirect-url value, which can be on the local web server or on a remote web server. If you do not specify a redirect-url value and an error occurs, an error page is raised internally in the mod_ jadehttp module.

In your jadehttp.conf file, you can use the TooBusy cause value for the FaultDocument directive to provide a custom error message for cases where there is a problem opening a network connection to Jade, including HTTP 502 (Bad Gateway) errors; for example, when a JadeRestService JSON exceptionFormat is ignored.

The following example configuration redirects you to a custom HTML page where you can make the body of the HTML page a JSON string.

<IfModule mod_jadehttp.c>
    <Location /Jade>
        JadeHttp_Trace 0xffff Logs/jadehttp.log 5M
        SetHandler jadehttp-handler
        ApplicationType RESTServices
        Application RESTApplication
        TcpConnection localhost 20005
        # The path is relative to 'htdocs'; for example, 
        # C:\Apache\htdocs\502-TooBusy.html, and htdocs is 
        # defined in your httpd.conf
        FaultDocument TooBusy /502-TooBusy.html
    </Location>
</IfModule>