Chapter 1: ColdFusion Tags
219
Note
In order to see the information displayed by TagContext, use the
ColdFusion Administrator to enable the CFML stack trace.Under
Debugging in the ColdFusion Administrator, choose the checkbox next to
"Enable CFML stack trace. "
Example
<!--- This example shows the use of CFTHROW. --->
<HTML>
<HEAD>
<TITLE>
CFTHROW Example
</TITLE>
</HEAD>
<BASEFONT FACE="Arial, Helvetica" SIZE=2>
<BODY bgcolor="#FFFFD5">
<H3>CFTHROW Example</H3>
<!--- open a CFTRY block --->
<CFTRY>
<!--- define a condition upon which to throw
the error --->
<CFIF NOT IsDefined("URL.myID")>
<!--- throw the error --->
<CFTHROW MESSAGE="ID is not defined">
</CFIF>
<!--- perform the error catch --->
<CFCATCH TYPE="application">
<!--- display your message --->
<H3>You’ve Thrown an <B>Error</B></H3>
<CFOUTPUT>
<!--- and the diagnostic feedback from the
application server --->
<P>#CFCATCH.message#</P>
<P>The contents of the tag stack are:</P>
<CFLOOP index=i from=1 to = #ArrayLen(CFCATCH.TAGCONTEXT)#>
<CFSET sCurrent = #CFCATCH.TAGCONTEXT[i]#>
<BR>#i# #sCurrent["ID"]#
(#sCurrent["LINE"]#,#sCurrent["COLUMN"]#) #sCurrent["TEMPLATE"]#
</CFLOOP>
</CFOUTPUT>
</CFCATCH>
</CFTRY>
</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...