Here's my code that works fine using CF 6.0:
Place this on your application.cfm page:
<cferror type="REQUEST"
template="error.cfm"
mailto="[EMAIL PROTECTED]">
<cferror type="EXCEPTION"
template="error.cfm"
mailto="[EMAIL PROTECTED]"
exception="ANY">
Place this code on an html page called error.cfm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>We're sorry -- an error occurred</title>
<link rel="STYLESHEET" type="text/css" href="\air/aircargo/Content/Style
Sheets/Style_Sheet.css">
</head>
<body text="Navy" link="Blue" vlink="Blue" alink="Blue">
<div align="center"><h3>We're sorry -- an error occurred</h3>
An error has occurred that prevents us from completing your request.
<br><br>
Never fear! We have a special team in Air Cargo Systems Support to
assist you in this matter. Typically, a situation like this is resolved
in a few hours. Please be patient.<br><br></div>
<cfmail to="#ERROR.MailTo#"
from="""Automated Error Notification System"" <#ERROR.MailTo#>"
subject="Air Cargo intranet error - #Error.Type#"
type="html">
<html>
<head>
<title>Error Report</title>
</head>
<body>
Error.Template: #Error.Template#<br>
Error.Browser: #Error.Browser#<br>
Error.Type: #Error.Type#<br>
Error.Remoteaddress: #Error.Remoteaddress#<br>
Error.HTTPReferer: #Error.HTTPreferer#<br>
Error.Datetime: #Error.datetime#<br>
URL.Parameters: #Error.QueryString#<br>
<hr color="##3366cc">
Error.Diagnostics: #Error.diagnostics#<hr color="##3366cc"><br>
Error.MailTo: #Error.Mailto#
</body>
</html>
</cfmail>
</body>
</html>
Let me know if you have questions.
Nancy
-----Original Message-----
From: Stephen Moretti [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 12, 2005 9:12 AM
To: CF-Newbie
Subject: Re: Custom Error Handling
Torrent Girl wrote:
>Ok, I don't know what I am doing wrong, but it's not working for me.
>
>Try to access this page: http://www.wifenetwork.org/members/rewards.cfm
>
>It is a page that is accessible only when one is logged in.
>
>Shouldn't my error page catch it and show my customixed error?
>
>
Need to check....
Do you have your cferror in *D:\INETPUB\wifenetwork\*Application.cfm and
the ErrorException.cfm file is in the same folder as your
Application.cfm?
If you do, try making your ErrorException.cfm into just a simple HTML
page which say "Sorry! An error has occurred. Try back later." or
something along those lines.
If that works, then try adding in a <cfdump var="#error#"> into the page
to be displayed.
If that works then you should be able to add in a CFMail to send the
cfdump to your chosen email address. Use the MailTo attribute of the
cferror tag to pass the email address to the error page, where it will
be available in the variable error.MailTo.
Hope that helps
Stephen
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:1291
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54