Adobe COLDFUSION 9 Manual page 298

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
</cfoutput>
<cfset errorCaught = "Database">
</cfcatch>
<!--- Use cfcatch with type="Any" --->
<!--- to find unexpected exceptions. --->
<cfcatch type="Any">
<cfoutput>
<hr>
<h1>Other Error: #cfcatch.Type#</h1>
<ul>
<li><b>Message:</b> #cfcatch.Message#
<li><b>Detail:</b> #cfcatch.Detail#
</ul>
</cfoutput>
<cfset errorCaught = "General Exception">
</cfcatch>
</body>
</html>
</cftry>
Use the following procedure to test the code.
Test the code
Make sure that there is no includeme.cfm file and display the page. The
1
displays the error.
Create a nonempty includeme.cfm file and display the page. If your database is configured properly, you see an
2
employee entry and do not get any error.
In the
tag, change the line:
3
cfquery
FROM Employee
to:
FROM Employer
Display the page. This time the
Change Employer to Employee.
4
Change the
line:
cfoutput
<p>Department: #Dept_ID#<br>
to:
<p>Department: #DepartmentID#<br>
Display the page. This time the
error.
Change DepartmentID back to Dept_ID and redisplay the page. The page displays properly.
5
Open \CFusion\Log\MyAppPage.log in your text editor. You should see a header line, an initialization line, and
four detail lines, like the following:
cfcatch type="Database"
block displays an error message indicating an expression
cfcatch type="Any"
Last updated 8/5/2010
cfcatch type="MissingInclude"
block displays an error message.
293
block

Advertisement

Table of Contents
loading

Table of Contents