Adobe COLDFUSION 9 Manual page 290

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
In general, production Exception and Request pages should not display detailed error information, such as that
supplied by the
error.diagnostics
administrative address or log the information using the
information on using the
cflog
Example of a request error page
The following example shows a custom error page for a request error:
<html>
<head>
<title>Products - Error</title>
</head>
<body>
<h2>Sorry</h2>
<p>An error occurred when you requested this page.</p>
<p>Please send e-mail with the following information to #error.mailTo# to report
this error.</p>
<table border=1>
<tr><td><b>Error Information</b> <br>
Date and time: #error.DateTime# <br>
Page: #error.template# <br>
Remote Address: #error.remoteAddress# <br>
HTTP Referer: #error.HTTPReferer#<br>
</td></tr></table>
<p>We apologize for the inconvenience and will work to correct the problem.</p>
</body>
</html>
Example of a validation error page
The following example shows a simple custom error page for a validation error:
<html>
<head>
<title>Products - Error</title>
</head>
<body>
<h2>Data Entry Error</h2>
<p>You failed to correctly complete all the fields
in the form. The following problems occurred:</p>
#error.invalidFields#
</body>
</html>
Logging errors with the cflog tag
ColdFusion provides extensive capabilities for generating, managing, and viewing log files, as described in Configuring
and Administering ColdFusion. It also provides the
variable. Typically, Exception pages e-mail detailed error information to an
cflog
tag, see
"Logging errors with the cflog
tag which adds entries to ColdFusion logs.
cflog
Last updated 8/5/2010
tag instead of displaying it to the user. For more
tag" on page 285.
285

Advertisement

Table of Contents
loading

Table of Contents