I wish to toggle friendly error messaging in ColdFusion 9. My app.cfm looks like:
<cfset App.EnableDebug = true>
<CFERROR TYPE="VALIDATION" TEMPLATE="/errorhandler.cfm">
<CFERROR TYPE="EXCEPTION" TEMPLATE="/errorhandler.cfm">
<CFERROR TYPE="REQUEST" TEMPLATE="/errorhandler.cfm">
Currently, my errorhandler.cfm looks at App.EnableDebug and either displays a friendly error message or a cfdump of the error variable and then a “megadump” of all defined variables (app, cgi, session, etc). My problem is we prefer the look/layout of the default error page provided by ColdFusion. However, we also like having the “megadump” of all our variables.
Now, I know that if I just comment out the cferror tags then ColdFusion will display it’s default error page. Which is pretty handy, except I wish to include a “megadump” of all my variables. Any way to merge my two desires into one reality?
The default error handler is just a CFM file. You can edit it, or replace it with whatever you like.
This file is located in the server instance’s WEB-INF/exception folder. The file name is detail.cfm