• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 26. Error Handling > Exception Handling

Exception Handling

<cferror> traps both parsing and run-time errors. Errors that occur when the template is executed are also called exceptions. Exceptions include any event that disrupts the normal flow of instructions in a ColdFusion page when it is being executed. Exceptions can be more intelligently handled than what you've seen so far using <cferror>.

<cftry>/<cfcatch>

When you use the <cftry>/<cfcatch> tag set, exceptions can be caught and then acted upon programmatically. For instance, instead of throwing an error when attempting to write a duplicate indexed value to a database, ColdFusion can catch the error, then inform the user of the problem and ask him to change the offending data.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint