previous section, we covered the basics of using
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
CFCATCH techniques we
As I mentioned in the previous
CFCATCH tag can accept a custom
exception type for its
TYPE attribute. That custom
exception type is defined using the
CFTHROW tag generates a custom exception type
that can be caught by a
CFCATCH tag when the
TYPE attribute is set to
Any, or the custom
type you specified in the
CFTHROW tag. In other
words, when something goes wrong in your application, and you need to
generate a custom exception, use
general syntax for using
CFTHROW is as follows:
CFTHROW tag accepts the following optional
Specifies a name for the exception type. You may give the exception
type a custom name or use the predefined type
Message describing the event that triggered the exception.
Specifies additional information about the exception.
A custom ...