Steve, btw you can rethrow if needed as well, just in case you might have forgotten,
On 8/27/07, Steve Onnis <[EMAIL PROTECTED]> wrote: > > Is this what you mean? > > <cffunction name="foo"> > <cfset var throw = true /> > <cftry> > <cfif throw> > <cfthrow message="CFTHROW Caught" detail="I have been caught from a > cfthrow" /> > </cfif> > <cf_set /> > <cfcatch> > <cfoutput> > <strong>#CFCATCH.Message#</strong> > </cfoutput> > </cfcatch> > </cftry> > </cffunction> > > <cftry> > <cfset foo() /> > <cfcatch> > <cfdump var="#cfcatch#"> > </cfcatch> > </cftry> > > > > > ------------------------------ > *From:* cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *AJ Mercer > *Sent:* Monday, 27 August 2007 5:58 PM > *To:* cfaussie@googlegroups.com > *Subject:* [cfaussie] Re: cfthrow in CFC > > > I am getting the email from within the catch - so it is caught. > > But maybe it dropped it again ;-) > > > <cftry> > <cfif CGI.HTTPS EQ 'off' OR CGI.SERVER_PORT_SECURE EQ 0> > <cfthrow type="Application" detail="This Web Service must > be run over HTTPS" message="This Web Service must be run over HTTPS" /> > </cfif> > > > > <cfcatch> > > <cfmail to="[EMAIL PROTECTED]" from=" [EMAIL PROTECTED]" > subject="ERROR: #APPLICATION.applicationname# - #CGI.SCRIPT_NAME# #now()#" > type="html"> > <cfdump var="#private#" label="private" /> > <cfdump var="#cfcatch#" label="error" /> > </cfmail> > > <cfset private.errorCode = CFCATCH.ErrNumber /> > <cfset private.errorText = CFCATCH.Message /> > <cfset private.success = 'False' /> > > <cfset responceXML = > getResponceXML(ArgumentCollection=private) />> > > </cfcatch> > </cftry> > > On 8/27/07, Steve Onnis <[EMAIL PROTECTED]> wrote: > > > > i didnt think you could catch after a throw. if you throw it thats it, > > the exception has been thrown and cant be caught. > > > > ------------------------------ > > *From:* cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] *On > > Behalf Of *AJ Mercer > > *Sent:* Monday, 27 August 2007 5:46 PM > > *To:* cfaussie@googlegroups.com > > *Subject:* [cfaussie] cfthrow in CFC > > > > > > If a function has a throw inside a try/catch, should the error be > > contained in that function? > > In the catch I send and email, and I received that. > > There is an email directly after the try / catch that is not getting > > sent > > > > I have the web service called by cfinvoke which is inside a try / catch > > and it is receiving the CFC function's error. > > > > I want the CFC function to handle error and send back a standard XML > > format (which will contain an error message if an error occurs). > > > > Cheers > > Andrew > > > > > > > > > > > > -- Senior Coldfusion Developer Aegeon Pty. Ltd. www.aegeon.com.au Phone: +613 8676 4223 Mobile: 0404 998 273 --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~----------~----~----~----~------~----~------~--~---