When a web browser makes a request to Panorama X Server, the displayed result is normally HTML generated by a procedure on the server. Sometimes, however, a problem gets in the way and no HTML is generated. For example, there could be a problem in the code, or a problem with your Panorama X account. When that happens, Panorama automatically generates a rather sparse error message for display in the browser. For a production system, you may want to display a custom page when an error occurs. On this help topic you’ll learn how to set up and specify a custom error page.

There are four possible errors that can trigger a custom error page:

To customize the error page you must provide an HTML file in this folder:

~/Library/Application Support/PanoramaX/Server/WebErrorTemplates/

For example, if you want to create a standard errorr response for a low balance situation, you’ll need to create an HTML file named LowAccountBalance.html. The name must exactly match from the list above.

~/Library/Application Support/PanoramaX/Server/WebErrorTemplates/LowAccountBalance.html

The LowAccountBalance.html file must contain the HTML content you want to display when this error occurs. (You can also supply plain text content, with no HTML tags.)

<html><head><title>Server Problem</title></head>
<body>
<hr>
<h2 align=center>Big Corp Server is currently unavailable.</h2>
<hr 50%>
<h3 align=center>Contact Web Admin at extension 3453</h3>
<hr>
</body></html>

If your Panorama X account balance goes to zero or negative, the template page will be displayed instead of the standard plain error message page.

Embedding Error Specific Information into the Template Page

Some errors have additional information associated with them – the name of the procedure, the code error message, etc. These items can be embedded into your template by using the item name surrounded by « and », for examle «procedure» or «error». The items supported by each type of error are listed below. The item name must be spelled exactly, including upper and lower case.

NotLoggedIntoAccount.html

There is no additional information available for this error.

LowAccountBalance.html

There is no additional information available for this error.

EmptyHTML.html

There are three items of additional information that can be embedded into the error template:

Here’s an example of an EmptyHTML.html template that includes some of this information.

<html><head><title>Server Problem</title></head>
<body>
<hr>
<h2 align=center>Internal server error.</h2>
<hr 50%>
<h3 align=center>Internal procedure «procedure» (belonging to database «database») 
did not generate any HTML.</h3>
<hr>
</body></html>

CodeError.html

There are about a half dozen items of additional information that can be embedded into the error template:

Here’s an example of a CodeError.html template that includes some of this information.

<html>
<head></head>
<body>
<hr>
<h1>Panorama Code Error</h1>
<hr>
<ul>
<li>ERROR: «error»</li>
<li>URL: «url»</li>
<li>STATEMENT: «statement»</li>
<li>PARAMETER: «parameter»</li>
</ul>
<hr>
</body>
</html>

Of course it’s best to avoid code errors in web publishing code if at all possible. If that’s not possible, you can trap these errors yourself using the try and catch statements. See Error Handling to learn how to use these statements. But if you miss a spot and an error slips through, the CodeError.html template allows you to control the message seen in the browser.


See Also


History

VersionStatusNotes
10.2NewNew in this version.