"extra work" in the sense that if it's always there, why check. I only want to check something when there is any chance of a doubt. I would expect there to always be an entry in an error dump for what template caused the error but it seems this is not the case.
The doc I dug up says that the tagcontext array is not always available and even when available it may be an empty array. On the other hand, if there is an element in the array, it will always have both the template and the line number. So it's down to a check for the tagcontext and a check for it's length. 2 is better than 6. -- Michael Dinowitz Lead Author - Adobe Coldfusion Anthology http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion On Mon, Jul 26, 2010 at 5:28 PM, Michael Grant <[email protected]> wrote: > > Personally I wouldn't consider checking for the existence of an > array/structkey/variable before outputting it "all that extra work." Also I > would say that relying on an element to exist in order to preserve the > integrity of a function/app/procedure is very good practice. My custom error > handlers are riddled with isDefined etc to preserve the integrity of the > error report. > > my $0.02 > > On Mon, Jul 26, 2010 at 5:13 PM, Michael Dinowitz < > [email protected]> wrote: > >> >> I hate doing all the extra work if it's not needed. There has to be 1 >> clause for one of the data values and 3 clauses for two of the others. >> ick. >> >> Also, remind me to request an attribute of output="true" for the next >> revision of cfsavecontent. I really hate having to add cfoutput around >> the whole thing. >> >> -- >> Michael Dinowitz >> Lead Author - Adobe Coldfusion Anthology >> >> http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion >> >> >> On Mon, Jul 26, 2010 at 5:05 PM, Raymond Camden <[email protected]> wrote: >> > >> > I want to say I have - but I have no proof. Why not just use an >> > arrayLen and structKeyExists check to be safe? >> > >> > >> > On Mon, Jul 26, 2010 at 4:01 PM, Michael Dinowitz >> > <[email protected]> wrote: >> >> >> >> I'm rewriting an email alert system for errors and part of it is >> >> pinpointing the error location early on in the email. This should be >> >> in the error dump as error.tagcontext[1].template. Has anyone seen an >> >> error dump that did not contain a tag context array? I'd hate to have >> >> an error reporter that throws an error. :) >> >> >> >> Thanks >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335735 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

