That's not valid code. Catch blocks should always be at the end of your try block and before any cffinal block. You can't put catch blocks in the middle and expect code that exists after a cfcatch to run. I can't think of any other language that allows that.
The only "buglet" I can see is that no bad template exception is being thrown due to due that occurs after the cfcatch block(s) and that it's silently ignoring it. To tell you the truth, I don't think it's something that needs fixing. Ernest McCloskey said the following on 03/05/2013 11:23 PM: > I think I found a possible bug in the system and would like some > verification. > > here is a part of the code: > > <cffunction name="deletePhoto" output="no" access="remote" > returntype="string"> > <cfargument name="thisPhoto" required="yes" type="numeric" /> > > <cftry> > <cfquery name="qChk" datasource="#Session.dbsource#" > username="#Session.dbuname#" password="#Session.dbpass#" maxrows="1"> > SELECT img, prodID > FROM photos > WHERE ID = #arguments.thisPhoto# > </cfquery> > > <cfquery name="qNum" datasource="#Session.dbsource#" > username="#Session.dbuname#" password="#Session.dbpass#"> > SELECT ID > FROM photos > WHERE prodID = #qChk.prodID# > </cfquery> > > > <cfcatch type="database"> > <cfreturn "There was an error in deleting the image. > Please check to make sure it has been Deleted" /> > </cfcatch> > > <cfreturn "WTF" /> > <!--- more code down below, it fails at this point, there are multiple > cfcatch but even removed it still has an issue ---> > > </cftry> > <cfreturn "1" /> > </cffunction> > > What is happening is, after the 1st 2 queries it jumps right to the > end and sends back a "1". if I move my return before the cfcatch tags > I get the proper answer back. Any thoughts? > > -- Peter J. Farrell OpenBD Steering Committee / Mach-II Lead Developer http://blog.maestropublishing.com Identi.ca / Twitter: @maestrofjp Please do not send me Microsoft Office/Apple iWork documents. Send OpenDocument instead! http://fsf.org/campaigns/opendocument/ -- -- online documentation: http://openbd.org/manual/ http://groups.google.com/group/openbd?hl=en --- You received this message because you are subscribed to the Google Groups "Open BlueDragon" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
