User Guide

198 Chapter 11 Preventing and Handling Errors
How ColdFusion handles errors
The following pseudo-code program illustrates how ColdFusion handles errors. The
rest of this expands on this outline:
Case missing template error
ColdFusion displays either a standard error page or an error page
that you specify as the Missing Template Handler in the
Administrator
Server Settings Missing Template Handler field.
Case validation error
If cferror in application.cfm specifies a validation error handler
Use error page specified by cferror
Else
Use standard CFML validation error message format
Endif
Case exception error
If a cferror tag in aplication.cfm specifies a monitor error handler
for the exception type
Use the Monitor error page; when the page exits continue handling
the error as follows
Endif
If code with error is inside a cftry tag and the exception type is
specified in a cfcatch tag (see Note)
Execute code in cfcatch tag
Else If a cferror tag specifies an exception error handler for the
exception type
Use error page specified by cferror
Else If Administrator Settings Site-wide Error Handler field
specifies an error handler page
Use custom error page
Else If a cferror tag specifies an request error handler
Use error page specified by cferror
Else
Use standard CFML error message
Endif
Note
If the current tag is nested inside other tags, the CFML processor checks the entire
stack of open tags until it finds a suitable cftry/cfcatch combination or reaches the
end of the stack.