Update: Download fixed
Here is a little intro to our (Lance Smith and myself) proposed presentations on error handling for CFUnited and MVCFUG....
Most developers know the importance of having error handling on their site. But, many do not know how extensible error handling can be and the control they have over it with the power and ease of ColdFusion.
Macromedia and now Adobe has been kind enough to provide us these error handling files. ColdFusion uses these files to output the errors to the browser. These files are:
{CFRoot\wwwroot}\WEB-INF\exception\detail.cfm
{CFRoot\wwwroot}\WEB-INF\debug\classic.cfm
{CFRoot\wwwroot}\WEB-INF\exception\exception_en.xml
{CFRoot\wwwroot}\WEB-INF\exception\gettemplate.cfm
{CFRoot\wwwroot}\WEB-INF\exception\errorcontext.cfm
My question goes out to all ColdFusion programers, why do we use <CFDump/> or other solutions in our error handling emails? Yes, <CFDump/> provides a lot of information, but have you looked at the size of those emails? All that extra HTML and CSS really adds up quickly. In my case, I am on a corporate Exchange server that only allows for a certain maximum size of my Exchange folders. And when you implement this <CFDump/> mindset into a legacy application that has never had error handling before, what do you get? You get a over capactiy Inbox in a couple days. Or in my case the first time I tried this, I had an over capacity Inbox in under 4 hours. (No wonder the ColdFusion server was unstable.)
So my solution to this problem was to use ColdFusion's classic.cfm and combine it with all of the other default ColdFusion error handling pages into a single template that can easily be copied from application to application or server to server. This template provides all of the error handling output that ColdFusion displays to browser but is ouput to an email. Here is an example of what it outputs:
At the top of the file, I have provide a way to customize the behavior of the error handling code.
Change the Name of the Application.
<cfparam name="application.applicationFriendlyTitle" default="My CF Application">
Users who receive this email.
<cfparam name="application.emailErrorUsers" default="">
Who is this email from?
<cfparam name="application.emailErrorFrom" default="">
DevUser=0. The template will email the error and display a nice user friendly error message to the enduser. DevUser=1 will output it to the screen.
<cfparam name="session.devUser" default="0">
This code is used to display a nice user friendly error message to the enduser.
<cfsavecontent variable="errorHtml">
<cfoutput>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>#application.applicationFriendlyTitle#</title>
<link href="/css/somestylesheet.css" rel="stylesheet" type="text/css" media="screen" /><!--- You will probably want to use a style sheet --->
</head>
<body>
<p class="explanation">
We apologize for any inconvenience, an email has been sent to #application.applicationFriendlyTitle# Support. <br />
Please click your browser's Back button and retry your request.
</p>
</body>
</html>
</cfoutput>
</cfsavecontent>