Chad,
I'm sure there are other ways, but here's what I do:
In Application.cfm:
<cfset ErrorEmail = "[EMAIL PROTECTED]">
<cferror type="Request" template="views/CFError.cfm"
mailto="#ErrorEmail#"/>
<cferror type="Exception" template="views/CFError.cfm"
mailto="#ErrorEmail#"/>
CFError.cfm:
<cfsetting enablecfoutputonly="true">
<CFIF ERROR.MailTo NEQ "">
<cfmail
TO="#ERROR.MailTo#"
FROM="#ERROR.MailTo#"
SUBJECT="Error on Page #ERROR.Template#"
type="html">
<strong>Error Date/Time:</strong> #ERROR.DateTime#<br />
<strong>Browser Information:</strong> #ERROR.Browser#<br />
<strong>URL Parameters:</strong> #ERROR.QueryString#<br />
<strong>Previous Page:</strong> #ERROR.HTTPReferer#<br /><br />
-------------Error Diagnostics----------------<br />
<cfdump var="#Error#">
</cfmail>
</CFIF>
<cfoutput>
<cfinclude template="/views/header.cfm">
<!--content container-->
<div id="content">
<h1>We're Sorry, There Was an Error Processing Your Request</h1>
<p>Oops,</p>
<p>There was an error processing your reqest which prevents us
from displaying the information you were looking for. An e-mail has
been sent to our system administrator providing detailed information
on this request. </p>
<p>We will attempt to correct the problem as soon as possible. An
e-mail has been sent to the system administrator with detailed
information on this error. </p>
<p>We apologize for any inconvenience.</p>
</div>
<cfinclude template="/views/footer.cfm">
</cfoutput>
HTH,
Jon
On Dec 13, 2006, at 3:27 PM, Chad Gray wrote:
> What is the best way to have an email sent with error information
> when a CF web site throws an error?
>
> Thanks!
> Chad
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:263977
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4