Used with one or more cfcatch tags. Together, they catch and process exceptions in ColdFusion pages. Exceptions are events that disrupt the normal flow of instructions in a ColdFusion page, such as failed database operations, missing include files, and developer-specified events.



Code that might throw an exception
One or more cfcatch blocks

See also

cfcatchcffinallycferrorcfrethrowcfthrowonErrorHandling Errors in the Developing ColdFusion Applications


ColdFusion MX: Changed cfscript to include try and catch statements that are equivalent to the cftry and cfcatch tags.


Within a cftry block, put the code that might throw an exception, followed by one ore more cfcatch tags that catch and process exceptions. This tag requires an end tag.



    myQuery = queryNew("id,name,amount","Integer,Varchar,Integer", 
    <cfloop query = "myQuery">
        <!--- Use a non-existent column --->
    <cfcatch type="any">
            <p><strong>Incorrect column referred. Please use the correct column.<strong><p>


Incorrect column referred. Please use the correct column.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy