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

Chapter 9. Error and Exception Handling > Basic Exception Handling

9.1. Basic Exception Handling

Exception handling allows you to test for and trap exceptions when they happen, so that your applications can respond to problems appropriately, as opposed to just throwing an error or invoking a separate error-handling template. With exception handling, it is usually possible to allow your application to continue functioning despite the fact that an exception has occurred.

Basic exception handling in ColdFusion uses two tags, CFTRY and CFCATCH. These tags allow you to identify potentially problematic areas of your application code and deal with anticipated exceptions where they are most likely to occur. The basic syntax for using CFTRY/CFCATCH is:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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