Chapter 1: ColdFusion Tags
39
Example
<!--- This example shows the use of CFERROR. --->
<HTML>
<HEAD>
<TITLE>CFERROR Example</TITLE>
</HEAD>
<BODY>
<H3>CFERROR Example</H3>
<P>CFERROR provides the ability to display customized
HTML pages when errors occur. This allows you to
maintain a consistent look and feel within your
application even when errors occur. Note that no CFML
can be displayed in the resulting templates except
for the specialized error variables.
<P>CFTRY/CFCATCH provides a more interactive way to
handle your CF errors within a CF template than CFERROR,
but CFERROR is still a good safeguard against general
errors.
<P>You can also use CFERROR within the Application.cfm
to specify error handling responsibilities for an entire
application.
<!--- Example of CFERROR call within a template --->
<CFERROR TYPE="REQUEST"
TEMPLATE="request_err.cfm"
MAILTO="[email protected]">
<!--- Example of the template to handle this error --->
<!---
<HTML>
<HEAD>
<TITLE>We’re sorry -- An Error Occurred</TITLE>
</HEAD>
<BODY>
<UL>
<CFOUTPUT>
<LI><B>Your Location:</B> #Error.RemoteAddress#
<LI><B>Your Browser:</B> #Error.Browser#
<LI><B>Date and Time the Error Occurred:</B> #Error.DateTime#
<LI><B>Page You Came From:</B> #Error.HTTPReferer#
<LI><B>Message Content</B>: <BR><HR width=50%>
<P>#Error.Diagnostics#<HR width=50%><P>
<LI><B>Please send questions to:</B>
<a href="mailto:#Error.MailTo#">#Error.MailTo#</A>
</CFOUTPUT>
</UL>
</BODY>
</HTML> --->
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...