Library Table of Contents Index Previous Next Comments

NetCache error codes

About NetCache error codes  Top

NetCache supports one proprietary error code (510), plus 11 additional codes that build on standard HTTP 1.1 error codes (200, 201, 302, 400, 401, 403, 407, 412, 500, 502, and 504).

Error message text files  Top

The text for each error code is stored in a file that begins with the number of the error code and ends with the extension ".htm." For example, the error message text for code 501 resides in 501.htm.

The following table shows the default error message text for the 12 error codes that NetCache supports. Each message can be modified by editing the HTML file associated with its error code. See <!--NETCACHE ERROR--> error tag for a definition of <! --NETCACHE ERROR-->.

Error
code

Default error message text
(user editable)

Explanation

200

OK

The request was successful.

201

Success

The request was successful.

302

Move Temporarily

You are being redirected to a new location because

<!--NETCACHE ERROR--> 

The requested URL, image file, or text form was moved to a new location.

400

Bad Request

The following error occurred:

<!--NETCACHE ERROR--> 

Please contact the administrator.

This general error message indicates that the origin server did not understand the request. Improper URL syntax, among other issues, can trigger this error.

401

Unauthorized

Authentication is required because

<!--NETCACHE ERROR--> 

The user is not authorized to access the origin server.

Note
When HTTP transparent authentication is enabled, NetCache (instead of the server) sends this error.

403

Forbidden

You were denied access because

<!--NETCACHE ERROR--> 

The origin server refused to allow the user to access it.

407

Proxy Authentication Required

Authentication is required because

<!--NETCACHE ERROR--> 

The NetCache appliance requires user authentication. This error appears in the Web access log, but it does not appear on screen. Instead, the Web browser displays a dialog box, which requires the user to enter a user name and password.

412

NetCache error

Error:

<!--NETCACHE ERROR--> 

The object was in the cache but the If-Match condition specified by the client failed (did not match).

500

Server Error

The following error occurred:

<!--NETCACHE ERROR--> 

Please contact the administrator.

This generic message indicates that a problem occurred on the origin server.

502

Bad Gateway

The following error occurred:

<!--NETCACHE ERROR--> 

Please contact the administrator.

The gateway tried to obtain a response from an origin server or another gateway, but the other device sent a negative response.

504

Gateway Timeout

The following error occurred:

<!--NETCACHE ERROR--> 

Please contact the administrator.

The gateway did not send a response within the timeout period.

510

Content Fill Error

The following error occurred:

<!--NETCACHE ERROR--> 

Please contact the administrator.

NetCache was unable to place an object into (or retrieve an object from) the object cache.

This is a proprietary NetCache error code.

<!--NETCACHE ERROR--> error tag  Top

The <!--NETCACHE ERROR--> error tag, which appears in most of the default error messages, is a proprietary variable that responds to the current error code by displaying the specific text string stored for that error code in the errors.desc file. For example, code 400 returns "Bad URL," whereas code 504 returns "Server unreachable."

You can change the output strings that the <!--NETCACHE ERROR--> error tag returns by editing errors.desc. The errors.desc file is a plain ASCII file similar to the numbered HTML files that store error message text for HTTP 1.1 error codes. The errors.desc file is listed in the Current Error Files list on the Data tab > Software > Error Pages page in the Appliance Manager. Message text in the errors.desc file overrides the default message text that NetCache provides.

Note
Everything between (and including) the angle brackets in the <!--NETCACHE ERROR--> error tag must be inserted into the appropriate error message text file intact and unchanged. Those strings will be converted to instance-specific text output when the error message is displayed.

Additional NetCache error tags  Top

You can insert one or more of the error tags shown in the following table into your error messages to supply instance-specific information when an error message is displayed.

For example, you can have NetCache respond to a failed page request by displaying the name of the blocked URL, the IP address of the client that made the request, and the date the failure occurred.

Variable

Description

<!--NETCACHE:URL-->

This string identifies the URL that was blocked.

<!--NETCACHE:USERNAME-->

This string identifies the user whose request failed.

<!--NETCACHE:CLIENT_IP-->

This string provides the IP address of the client that made the failed request.

<!--NETCACHE:DATE-->

This string specifies when the failed request was made.

<!--NETCACHE:HOST_NAME-->

This string provides the host name of the NetCache appliance that is processing the error.

<!--NETCACHE:CATEGORY-->

This string indicates the SmartFilter or WebWasher DynaBLocator category that applies to the current error code.

When the error message is displayed, each string is replaced with the current value of the variable. For example, the message
"Your request for <!--NETCACHE:URL--> has been denied." might be displayed as "Your request for http://www.anysite.com has been denied."

Note
Everything between (and including) the angle brackets in the error tags must be inserted into the appropriate error message text file intact and unchanged. Those strings will be converted to instance-specific text output when the error message is displayed. The only error tag for which you can edit the output strings is the <!--NETCACHE ERROR--> error tag.

Error tag syntax  Top

The following example illustrates the proper use of error tags in an error message text file.

<HTML>
<HEAD><TITLE>403 Forbidden</TITLE></HEAD>
<BODY>
<H1>Forbidden</H1>
<H4>
You were denied access because:<P>
<!--NETCACHE ERROR--><P>
DATE:<!--NETCACHE:DATE--><P>
URL:<!--NETCACHE:URL--><P>
USERNAME:<!--NETCACHE:USERNAME--><P>
CLIENT_IP:<!--NETCACHE:CLIENT_IP--><P>
CATEGORY:<!--NETCACHE:CATEGORY--><P>
<H4>
<HR>
</BODY>
</HTML>

Error message file output  Top

Viewed within a Web browser, the preceding HTML file produces the following output.

Library Table of Contents Index Previous Next Comments