When I do 

<cfset throw()>

The tag context's first element line # _is_ the line number of the
cfthrow in the throw method, however item 2 is is the method that called
throw, and item 3 is the caller tag. This covers everything.

I modified my cfc method to do this:

        <cffunction name="test">
                
                <cfscript>
                throw("Test one");
                </cfscript>
                
                <cfreturn now()>
                
        </cffunction>

and -still- it worked correctly. Are you not seeing this?

========================================================================
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Oliver Tupman [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, July 23, 2003 9:27 AM
> To: CF-Talk
> Subject: Re: Throwing exceptions from CFCs
> 
> 
> Raymond Camden wrote:
> 
> > Ah, so you need to know _who_ called your method in the 
> incorrect way, 
> > right?
> 
> Erm, wrong way round - I'm after being able to know _where_ the 
> exception occurred. For example, the following listing was 
> caused by the <cfthrow> on line 65.
> 
>   The Error Occurred in 
> /opt/coldfusionmx/CustomTags/qa/Base.cfc: line 65 Called from 
> /opt/coldfusionmx/CustomTags/qa/Bug/BugSet.cfc: line 96 
> Called from /var/www/qasystem/bugs/act_GetBugs.cfm: line 9 
> Called from /var/www/qasystem/bugs/fbx_Switch.cfm: line 54 
> Called from /var/www/qasystem/fbx_fusebox30_CF50.cfm: line 
> 241 Called from /var/www/qasystem/index.cfm: line 10
> 
> 63 :                  <cfset Table = "#Table#."/>
> 64 :          </cfif>
> 65 :          <cfthrow>
> 66 :          <cfreturn query/>
> 67 :
> 
> If that was called from a cfscript'd Throw() then the code 
> listing would 
> be in the Throw() function, not from the place where Throw() 
> was called.
> 
> I think I'm after some way to modify the exception context 
> that is part 
> of an exception object obtained by
> 
>    catch(any excpt)
> 
> with excpt being the exception object. Unfortunately I can't seem to 
> work out how to modify the exception context that lives within the 
> exception object.
> 
> If I could modify it, then I could take on extra info and simply pass 
> that to my Throw() function.
> 
> 
> > 
> ======================================================================
> > ==
> > ===
> > Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
> > (www.mindseye.com)
> > Member of Team Macromedia 
> (http://www.macromedia.com/go/teammacromedia)
> > 
> > Email    : [EMAIL PROTECTED]
> > Blog     : www.camdenfamily.com/morpheus/blog
> > Yahoo IM : morpheus
> > 
> > "My ally is the Force, and a powerful ally it is." - Yoda
> > 
> > 
> >>-----Original Message-----
> >>From: Oliver Tupman [mailto:[EMAIL PROTECTED]
> >>Sent: Wednesday, July 23, 2003 9:15 AM
> >>To: CF-Talk
> >>Subject: Re: Throwing exceptions from CFCs
> >>
> >>
> >>Raymond Camden wrote:
> >>
> >>
> >>>Query - in what way do you need the exceptioncontext? If the error
> >>>involves method foo and arg X, couldn't you just do
> >>>
> >>><cfthrow message="You passed X to method Goo. X needs to be over
> >>>whatever." type="mycfc">
> >>
> >>Yes I could, but that is not my primary problem. the primary
> >>problem is 
> >>the exception context - the file/line number list you get 
> >>when there is 
> >>an error/exception. It's this context that I think Cold 
> >>Fusion uses to 
> >>display the file/linenumber stack trace and the 4/5 line 
> outtake from 
> >>the code where the error/exception took place.
> >>
> >>
> >>
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

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

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to