Chapter 1: ColdFusion Tags
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="admin@mywebsite.com">
<!--- 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%>
<LI><B>Please send questions to:</B>
</CFOUTPUT>
</UL>
</BODY>
</HTML>
<P>#Error.Diagnostics#<HR width=50%><P>
<a href="mailto:#Error.MailTo#">#Error.MailTo#</A>
--->
39
Need help?
Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?
Questions and answers