Handling Errors - Adobe 38043740 - ColdFusion Standard - Mac Development Manual

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
<cfquery datasource="cfdocexamples" name="master"
cachedWithin="#CreateTimeSpan(0,1,0,0)#">
SELECT * FROM Employees
</cfquery>
Providing visual feedback to the user
If an application takes a while to process data, it is useful to provide visual feedback to indicate that something is
happening, so the user does not assume that there is a problem and requests the page again. Although doing this does
not optimize your application's processing efficiency, it does make the application appear more responsive.
Use the
tag to return partial data to a user, as shown in
cfflush
page 703
.
You can also use the
cfflush
"Understanding Progress Meters in ColdFusion 5" at www.adobe.com/go/learn_cfu_progress_meters_en. (Although
this article was written for ColdFusion 5, it also applies to later versions of ColdFusion.)

Handling Errors

Adobe ColdFusion includes many tools and techniques for responding to errors that your application encounters.
These tools include error handling mechanisms and error logging tools.
For information on user input validation, see
"Building Dynamic Forms with cfform
Troubleshooting
Applications" on page 378.
About error handling in ColdFusion
By default, ColdFusion generates its own error messages when it encounters errors. In addition, it provides a variety
of tools and techniques for you to customize error information and handle errors when they occur. You can use any
of the following error-management techniques.
• Specify custom pages for ColdFusion to display in each of the following cases:
• When a ColdFusion page is missing (the Missing Template Handler page)
• When an otherwise-unhandled exception error occurs during the processing of a page (the Site-wide Error
Handler page)
You specify these pages on the Settings page in the Server Settings page in the ColdFusion Administrator; for more
information, see the ColdFusion Administrator Help.
• Use the cferror tag to specify ColdFusion pages to handle specific types of errors.
• Use the
,
,
cftry
cfcatch
where they occur.
• In CFScript, use the
and
try
• Use the onError event in Application.cfc to handle exception errors that are not handled by try/catch code on the
application pages.
• Log errors. ColdFusion logs certain errors by default. You can use the
The following information is detailed in the next few topics:
• The basic building blocks for understating types of ColdFusion errors and how ColdFusion handles them
tag to create a progress bar. For information on this technique, see the technical article
"Introduction to Retrieving and Formatting
Tags" on page 722 For information on debugging, see
, and
tags to catch and handle exception errors directly on the page
cfthrow
cfrethrow
statements to handle exceptions.
catch
Last updated 1/20/2012
"Introduction to Retrieving and Formatting
Data" on page 703 and
tag to log other errors.
cflog
275
Data" on
"Debugging and

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents