94
Developing Web Applications with ColdFusion
<P>An error occurred when you requested this page.
Please email the Webmaster to report this error.
We will work to correct the problem and apologize
for the inconvenience.</P>
<TABLE BORDER=1>
<TR><TD><B>Error Information</B> <BR>
#Error.DateTime# <BR>
#Error.Template# <BR>
#Error.RemoteAddress# <BR>
#Error.HTTPReferer#
</TD></TR></TABLE>
</CFOUTPUT>
</BODY>
</HTML>
Example of a validation error
The following example shows a custom error page for a validation error.
<HTML>
<HEAD>
<TITLE>Products - Error</TITLE>
</HEAD>
<BODY>
<H2>Oops</H2>
<P>You failed to complete all the fields
in the form. The following problems occurred:</P>
#Error.InvalidFields#
</BODY>
</HTML>
Overview of Exception Handling in ColdFusion
Ordinarily, when ColdFusion encounters an error, it stops processing. However, you
can use ColdFusion’s exception handling tags to catch and process exceptions in
ColdFusion pages. Exceptions include any event that disrupts the normal flow of
instructions in a ColdFusion page, such as failed database operations, missing include
files, or developer-specified events.
In order for your code to handle an exception, the tags in question must appear within
a CFTRY block. It’s a good idea to enclose an entire application page in a CFTRY block,
and use a CFCATCH blocks to trap potential errors. When an exception occurs within
the CFTRY block, processing is ’thrown’ to the CFCATCH block.
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...