Re: Help Please - Having trouble with cferror
My understanding is that you can't use cf code at all in an error template. You have access to a few vars. You can use mailto in cferror to send an e-mail on error. You can use CF code in a cfcatch if you trap your error that way. David Schmidt [EMAIL PROTECTED] 05/23/02 02:52PM Hey all, I'm having a bit of a brain fart here. I want to have a particular site send the details of the error message when a message occurs. The plan I have is this, but it doesn't seem to be working. \root\Application.cfm (contains a cferror tag, type=exception mailto=myemailaddr template=errors/errorhandler.cfm ...) \root\errors\Application.cfm (just holds a comment); \root\errors\errorhandler.cfm (contains code to loop over the error object if it exists, putting the messages in a cfmail tag) I've been able to use cf code in an error template before (think I was tinkering with it some time ago, can't find the code). Anyone have an idea on what I might be missing? Thanks All David __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Help Please - Having trouble with cferror
Your code is most likely throwing an exception error, after which no CFML can be processed. There are multiple error types which may be thrown (exception, request, monitor and some other I can't remember). Though you did not say it, I bet your cfmail tag is getting processed some times (like when a request error is thrown), leading you to believe the code in the error template is buggy. Use multiple error handling templates (in your application.cfm), something like this: cfparam name=ExceptionHandling default=1 cfif ExceptionHandling eq 1 cferror type=request template=errorrequest.cfm mailto=#variables.ErrorEmail# cferror type=exception template=errorexception.cfm mailto=#variables.ErrorEmail# /cfif Forta's CF5 WACK book covers this in detail- HTH. -Craig __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Help Please - Having trouble with cferror
This WAS true with earlier versions, but the error page is MUCH more robust now, starting with V 4.5 I think. Are you trying to make it work with a V 4.0 CF Server? On 5/24/02 11:55 AM, BEN MORRIS [EMAIL PROTECTED] wrote: My understanding is that you can't use cf code at all in an error template. You have access to a few vars. You can use mailto in cferror to send an e-mail on error. You can use CF code in a cfcatch if you trap your error that way. David Schmidt [EMAIL PROTECTED] 05/23/02 02:52PM Hey all, I'm having a bit of a brain fart here. I want to have a particular site send the details of the error message when a message occurs. The plan I have is this, but it doesn't seem to be working. \root\Application.cfm (contains a cferror tag, type=exception mailto=myemailaddr template=errors/errorhandler.cfm ...) \root\errors\Application.cfm (just holds a comment); \root\errors\errorhandler.cfm (contains code to loop over the error object if it exists, putting the messages in a cfmail tag) I've been able to use cf code in an error template before (think I was tinkering with it some time ago, can't find the code). Anyone have an idea on what I might be missing? Thanks All David __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Help Please - Having trouble with cferror
My understanding is that you can't use cf code at all in an error template. You have access to a few vars. You can use mailto in cferror to send an e-mail on error. You can use CF code in a cfcatch if you trap your error that way. This is only true if you use TYPE=REQUEST or TYPE=VALIDATION within your CFERROR tag. If you use TYPE=EXCEPTION, your CFERROR page can have whatever CFML code you like within it. You can also use whatever code you like within your site-wide error handler page. It's a good idea not to do anything too complex in there, though, as you may cause an error within your error handler, which defeats the purpose of an error handler - the end user would see the regular CF error page. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Help Please - Having trouble with cferror
Your code is most likely throwing an exception error, after which no CFML can be processed. There are multiple error types which may be thrown (exception, request, monitor and some other I can't remember). Though you did not say it, I bet your cfmail tag is getting processed some times (like when a request error is thrown), leading you to believe the code in the error template is buggy. Sorry, I wrote that wrong, reverse 'exception' and 'request'.I meant to write: Your code is most likely throwing a request error, after which no CFML can be processed. There are multiple error types which may be thrown (exception, request, monitor and validation). Though you did not say it, I bet your cfmail tag is getting processed some times (like when a exception error is thrown), leading you to believe the code in the error template is buggy. -Craig (I'm glad it's Friday afternoon). __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists