Server-Wide Error Handling
ColdFusion provides site administrators with a way to handle errors and exceptions at the server level. Via the ColdFusion Administrator, you can designate a template to handle requests for CFML templates that don’t exist on the server. You can also specify an additional template that is invoked when an error or exception occurs anywhere within your ColdFusion application.
Missing Template Handler
Within the Settings section of the ColdFusion Administrator, there is a place for you to specify a Missing Template Handler. This template is called if a requested ColdFusion template can’t be found on the server, allowing you to avoid the dreaded “404 Object Not Found” error that otherwise results. Note that the Missing Template Handler isn’t invoked for template types other than CFML. In other words, requests for missing HTML templates are handled by the web server, not ColdFusion. When setting the Missing Template Handler, you should provide the relative path (in ColdFusion MX) such as /MissingTemplateHandler.cfm or the physical path (in ColdFusion 5) such as d:\inetpub\errorhandlers\MissingTemplateHandler.cfm to the template’s location on your ColdFusion server. If you are using ColdFusion MX, the relative path is relative to your web root directory.[2]
If the template you are calling attempts to call another template
that doesn’t exist, such as a custom tag call,
cfmodule, or cfinclude,
ColdFusion generates a MissingInclude exception but doesn’t invoke ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access