Catching and displaying thrown errors

The cfcatch tag catches a custom exception when you use any of the following values for the cfcatchtype attribute:

  • The custom exception type specified in the cfthrow tag.

  • A custom exception type that hierarchically matches the initial portion of the type specified in the cfthrow tag. For more information, see the next section, Custom error type name hierarchy.

  • Application, which matches an exception that is thrown with the Applicationtype attribute or with no type attribute.

  • Any, which matches any exception that is not caught by a more specific cfcatch tag.

Similarly, if you specify any of these types in a cferror tag, the specified error page displays information about the thrown error.

Because the cfthrow tag generates an exception, a Request error handler or the Site-wide error handler can also display these errors.