December 18th, 2003, 06:19 PM
I'm having some troubles with handling errors.
First off I'm using a content management system for my CFML pages.
Anyways that shouldn't really matter.
So in the application.cfm file, I have:
My error.cfm file contains:
However, on an error, the page refuses to send me an email
<CFMAIL server="#mailserver#" from="email@example.com" to="#Error.MailTo#" subject="Auto Error Report">
Error occured in template: #Error.Template#
At this time: #Error.DateTime#
The query string was: #Error.QueryString#
The referring page was: #Error.HTTPReferrer#
Web browser used: #Error.Browser#
A detailed diagnostic follows:
Sorry, there was an error processing your request for page: #Error.Template##Error.QueryString#
<p>The error has been brought to our attention and will be fixed as soon as possible.
<br/>Sorry for any inconvenience caused.</p>
display the message. Instead it throws out the error. Do any of
you see anything wrong with this?
December 19th, 2003, 10:37 AM
Try just doing this:
<cferror type="EXCEPTION" template="error.cfm">
exceptionType is "any" by default, and the mailto doesn't really do anything as far as I know.
Also is the error.cfm file in the same dir as your application.cfm file? Also, can you test out the error.cfm file on its own...I think CF gets nutty if your error template itself has an error in it, it has no choice but to show the raw error.
So not too much help, but I can tell you that we are using a similar technique and it works just fine, so it CAN be done!
December 20th, 2003, 05:23 PM
Though I just found out that it was indeed the CMS causing
the problem because I couldn't put CF tags on the error page.
There still seems to be more problems. Guess I'll have to figure
it out myself or get some support from the CMS..