> Its extremely hard to determine which method call threw the
> error, unless your framework bubble up errors well
Just a thought, cfcatch does a good job of providing a 'breadcrumb'...
you could have a generic throw function?
<cffunction name="tracethrow">
<cfargument name="message">
<cfset var err = structnew()>
<cftry>
<cfthrow message="#arguments.message#">
<cfcatch>
<cfset err = duplicate(cfcatch)>
</cfatch>
</cftry>
<!--- process the cfcatch output here, particularly the tagcontext
array --->
</cffunction>
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Adrocknaphobia
Sent: 15 April 2005 14:40
To: [email protected]
Subject: Re: [CFCDev] cflocation in cfc
Yeah I really prefer #3 myself. #2 does work wel as long as your
applications are coded for it. At my office we build all of our
applications off a core framework that handles it and all the
developers know how to code for errors (Although getting them to code
for errors is another can of worms)
As for the location of the error, this has always been an issue,
especially when methods are called multiple times from different
methods. Its extremely hard to determine which method call threw the
error, unless your framework bubble up errors well, then you can see
the entire 'breadcrumb' trail so you know where it originated.
-Adam
On 4/15/05, David Ross <[EMAIL PROTECTED]> wrote:
> I typically inject a logging service into any component that needs it,
> and log the errors where they occur... then throw/rethrow/return as
> neccessary.
>
> -Dave Ross
>
> >>> [EMAIL PROTECTED] 04/15/05 3:06 AM >>>
> one problem ive found with #3 is with error logging.
>
> say ive got this scenario
>
> page.cfm -> a.doSomthing() -> b.doSomething() -> c.doSomething()
>
> sometimes you dont get the correct line number thats causing the error.
> if the error is logged in b then i points to the line of
> c.doSomething(), but thats not very helpfull if c.doSomething() is
> massive! (it shouldnt be i know, but sometimes it is) or even if the
> chain acutally extends beyond c.
>
> Just wondering how everyone using method #3 treats error Logging ? If
> you dont do error logging, if their was a requirement for developers to
> be notifed of the exact line causing exceptions in your code, how would
> you handle it ?
>
> Pat
>
> Sean Corfield wrote:
>
> >On 4/14/05, Adrocknaphobia <[EMAIL PROTECTED]> wrote:
> >
> >
> >>1) Defined return.
> >>2) Error handling methods on all components.
> >>3) cfthrow.
> >>
> >>
> >
> >#3 gets my vote.
> >
> >
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to
> [email protected] with the words 'unsubscribe cfcdev' as the subject of
> the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
> (www.cfxhosting.com).
>
> An archive of the CFCDev list is available at
> www.mail-archive.com/[email protected]
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
>
> An archive of the CFCDev list is available at
> www.mail-archive.com/[email protected]
>
>
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]