Steve asks:
Huge problem I have: custom Error Handling in CF 8 doesn't work whatever I do. I use a simple Application.cfm:
<cferror type="exception" template="ErrorException.cfm" mailto="info@mysite.com">
ErrorException.cfm exists and is NOT empty
The template generating the error is index.cfm:
<cfoutput>#i#Is there any other setting I have to enable/disable in CF Admin for this to work? I still get the default CF error message, nothing custom.
What you have is a compiler error, or a syntax error. Consider the normal CF execution process. You request index.cfm. CF takes your ColdFusion and compiles it into Java. In your case, you have a syntax error. CF can't run your code at all - therefore - error handling can't handle it at all. The only fix for your template is to remove the syntax error. If you then ran your file and "i" was never defined, you would correctly see your error template run.
If I may be so bold (yes, I'll do), you should check out my guide on error handling:
The Complete Guide to Adding Error Handling to Your ColdFusion Application. It's guaranteed to be more exciting than filing taxes!
Archived Comments
And that is a good thing, otherwise you could find yourself debugging that template like MAD
Also, note that compile-time errors (such as syntax errors) will be caught by the site-wide Error Handler defined in the CF Admin. And in that site-wide Error Handler CFM template, you have access to the Error scope, as well as CGI, URL, FORM, etc. from the page where the error originally occurred. As Ray has pointed out in some of his posts, when you use this site-wide Error Handler, the 'normal' logging of the error in the logs doesn't take place, so you'll need roll your own and/or email it to yourself.
Again as Ray's pointed out many times, it's essential that you have good, well-thought-out error-handling strategy that handles *all* types of errors. Thanks Ray!
I am trying to add error handling using type="exception", but it does not work for me.When i am using type="request",it shows good page.Do i need to use any patch or fix etc..
You need to say _how_ it isn't working for you.