> -----Original Message----- > From: Raymond Camden [mailto:[EMAIL PROTECTED] > Sent: Friday, December 03, 2004 12:20 PM > To: CF-Community > Subject: Re: job rant > > > A function for cfthrow: There is a very good reason for this - by > > > defining a Throw() method, I can use the same base Type attribute for > > > all my throw statements. It also lets me do logging if I chose to. I > > > use this technique in almost all of my CFCs now. > > Hm. Can you do me a favor and write up a paper for FA or a blog entry > about this > > in more detail? Sounds interesting and if there's a valid reason, others > may > > want to do the same. > > Well, it is pretty simple. I think that a CFC, when it throws an > exception, should use a particular format for the TYPE attribute. For > example, if the CFC is called Foo, the type would be Foo, or > Foo.SUBTYPE (ie, Foo.Authentication). By using the method, I enforce > the syntax on the type value. That's it. I'm not sold on the > technique, but it was the thinking I had.
For what it's worth I do this with the exception of adding a specific identifier to the type. The "getProp()" method of DPComponent can throw two errors: DPComponent.getProp.PropNotInitialized DPComponent.getProp.PropNotDefined This way I can catch a specific error or class of error easily (determining if the property is not initialized, or if an error occurring in the method or in the CFC). In practice my framework also prepends tge package name as well, so this would be "DPFramework.DPComponent.getProp.PropNotDefined". That lets me easily distinguish between my errors and system errors. Works a treat and although it can be cumbersome to remember during initial development it makes debugging much easier. Jim Davis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Special thanks to the CF Community Suite Silver Sponsor - RUWebby http://www.ruwebby.com Message: http://www.houseoffusion.com/lists.cfm/link=i:5:138714 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/5 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:5 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
