RE: [cfaussie] Re: Catching cfcomponent extends errors
AJ, I think Kai and Mark may have been on the right track: with CFERROR (which would typically be setup at the application level, in application.cfm) or the onerror method of application.cfc, I'm pretty sure those COULD catch the fact that the code in your requested page had a compile-time error. Not able to setup a test at the moment. Let us know if it helps. And sure, the site-wide error would work, as well, but I realize you want finer control. Besides these being application-level, you can even (within the error handler) look for specific errors and handle them individually. Hope that's helpful. /charlie -Original Message- From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of AJ Dyka Sent: Tuesday, June 07, 2011 10:00 PM To: cfaussie Subject: [cfaussie] Re: Catching cfcomponent extends errors True, however I want to fix the mapping not just hide the error ... perhaps I can write my own error template which checks the mappings and fixes them if they're missing? That could work for me ... On Jun 8, 11:05 am, MrBuzzy mrbu...@gmail.com wrote: But using a global error handler will enable you to not show the error on-screen. -- You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en. -- You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
Re: [cfaussie] Re: Catching cfcomponent extends errors
On Thu, Jun 9, 2011 at 10:13 AM, charlie arehart charlie_li...@carehart.org wrote: AJ, I think Kai and Mark may have been on the right track: with CFERROR (which would typically be setup at the application level, in application.cfm) or the onerror method of application.cfc, I'm pretty sure those COULD catch the fact that the code in your requested page had a compile-time error. Not able to setup a test at the moment. Let us know if it helps. If the problem is an Application.cfc that extends a mapped CFC without the mapping in place, then no other code has executed so nothing can call cferror to set up a handler and onError() won't apply because Application.cfc can't even be compiled. The *only* possible handler for a bad extends= on Application.cfc is the global handler in the admin AFAIK (and at that point I don't think you can do much by way of recovery?). -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Railo Technologies, Inc. -- http://www.getrailo.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
RE: [cfaussie] Re: Catching cfcomponent extends errors
Ah, I missed that it was in application.cfc itself. My bad. Sorry. /charlie -Original Message- From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of Sean Corfield Sent: Thursday, June 09, 2011 4:42 PM To: cfaussie@googlegroups.com Subject: Re: [cfaussie] Re: Catching cfcomponent extends errors On Thu, Jun 9, 2011 at 10:13 AM, charlie arehart charlie_li...@carehart.org wrote: AJ, I think Kai and Mark may have been on the right track: with CFERROR (which would typically be setup at the application level, in application.cfm) or the onerror method of application.cfc, I'm pretty sure those COULD catch the fact that the code in your requested page had a compile-time error. Not able to setup a test at the moment. Let us know if it helps. If the problem is an Application.cfc that extends a mapped CFC without the mapping in place, then no other code has executed so nothing can call cferror to set up a handler and onError() won't apply because Application.cfc can't even be compiled. The *only* possible handler for a bad extends= on Application.cfc is the global handler in the admin AFAIK (and at that point I don't think you can do much by way of recovery?). -- Sean A Corfield -- (904) 302-SEAN -- You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
[cfaussie] Re: Catching cfcomponent extends errors
Not what I was hoping for :-/ Oh well ... I think that restructuring the relationship between by CFCs will be the only solution but it's not something I'm willing to think about at the moment! Thanks anyway :) On Jun 8, 10:30 am, Sean Corfield seancorfi...@gmail.com wrote: This is a *compile-time* error so no code is executing at the time the compiler hits that error. It's why you cannot use per-application mappings here - it's the very first piece of code the compiler sees and until it has compiled it, there's no code to run - and therefore nothing executed that can possibly trap the error. In other words, you cannot catch this error. On Tue, Jun 7, 2011 at 5:07 PM, AJ Dyka ajd...@learnosity.com wrote: I've done some searching and haven't found any answers yet so I figured I'd throw the question out here and see what comes back :) I have an Application.cfc in an app which I want to extend another which is accessed via a mapping like so: cfcomponent output=false extends=mapping.ParentApplication My issue is when the mapping doesn't exist it fails which is fine but I want to catch the error and handle it rather than just dump the error to the screen. -- You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
[cfaussie] Re: Catching cfcomponent extends errors
True, however I want to fix the mapping not just hide the error ... perhaps I can write my own error template which checks the mappings and fixes them if they're missing? That could work for me ... On Jun 8, 11:05 am, MrBuzzy mrbu...@gmail.com wrote: But using a global error handler will enable you to not show the error on-screen. -- You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.