I always return a three element struct from the facade cfc. One element is a success flag, another element is an errormessage that the flash app will reference and display in the event success=0, and the third element is the query,string,etc (the data obj). I have not run into a need to return type any? Can't speak to the overhead, sorry. As for the throw in the script block that would rock, but Rays idea of the private method throw() that you can call from the script block works for me right now.
Take care, Justin -----Original Message----- From: Jeff Battershall [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 1:47 PM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] Error Handling Best Practices - response to RE: [CFC Dev] Error Handling Strategies Thanks Ray. And thanks to everyone else who replied. But there's no way to "globally" or "automatically" or "auto-magically" capture the errors as such, right? I don't think there is but I'm just checking to see if I've missed something. What happens in situations where the CFC method is supposed to return a query, but when an exception is thrown, a struct is sent back? Only way I could see would be to set returntype to "any" in every method. Does that create overhead due to Flash having to evaluate the returned object type? Jeff -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Raymond Camden Sent: Wednesday, July 09, 2003 2:34 PM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] Error Handling Best Practices - response to RE: [CFC Dev] Error Handling Strategies I also use a custom throw in my cfc. This allows me to set ONE type for the entire CFC and just do this in various methods, <cfset throw("You screwed up you dog-faced idiot!")> ======================================================================== === 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: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Justin Balog > Sent: Wednesday, July 09, 2003 1:30 PM > To: '[EMAIL PROTECTED]' > Subject: FW: [CFCDev] Error Handling Best Practices - > response to RE: [CFC Dev] Error Handling Strategies > > > Howdy, > > Concerning Error handling, Sean C. sent this reply to my > question (his email follows below these code samples of > mine), and I have run with it. I do wrap the the methods of > the cfcs, and the facade cfcs to catch errors, but on error I > call a private method in the cfc "throw()" which handles the > exception by calling various other cfcs to log it, notify > someone, retry, whatever? There is probably a better way to > do it, but this is how I am currently handling it. > > Excerpt from a cfc called by the facade cfc: > ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
