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

9. Error and Exception Handling > 9.2. Custom Exception Handling

Custom Exception Handling

In the previous section, we covered the basics of using cftry/cfcatch to handle predefined types of exceptions that might occur within a ColdFusion application. While these general exception types can handle any type of exception, they do so in a generic, one-size-fits-all manner. Fortunately, ColdFusion also allows you to specify custom exception types that can be caught with the same cftry/cfcatch techniques we already covered.

As I mentioned in the previous section, the cfcatch tag can accept a custom exception type for its type attribute. That custom exception type is defined using the cfthrow tag. The cfthrow tag generates a custom exception type that can be caught by a cfcatch tag when the


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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