In that case, why save the result, since a failure will result in an exception?!
Just do: <cfset controller.DeleteStudent(argumentCollection ="#args#") /> Instead and save a variable allocation. Roland -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Barry Beattie Sent: Thursday, March 31, 2005 10:03 PM To: [email protected] Subject: Re: [CFCDev] exceptions and passing context specific error messages to the UI you mean like this? <cftry> <cfset bOK = controller.DeleteStudent(argumentCollection ="#args#") /> <cfcatch type="database"> <!--- check to see which type of errors are thrown... if things like duplicate key index, display restart message else rethrow? ---> </cfcatch> <cfcatch type="custom"> <!--- this is where I suspect the business logic errors are caught---> </cfcatch> </cftry> <!--- any others left over are handled by CFERROR? ---> so the only throw/catch is done by the UI in the initial call? none of the model/controller CFC's try/catch (except in rare cases eg: roll back something) - they just cfthrow? is there anything wrong with such a simple way as this, as far as site-wide error handling or loss of tag trace info for logging? this would be fine for 99% of the time (and the other 1% would be "try->catch->rethrow" )? thanx barry.b On Thu, 31 Mar 2005 20:18:40 -0500, Patrick McElhaney <[EMAIL PROTECTED]> wrote: > This must be April Fools Day. Someone asked a non-trivial question to > which there is a 100% affirmatively without-a-doubt "RIGHT" answer. :) > > Barry, when your method deliberately fails use the <cfthrow> tag to > throw an exception. > > Patrick > > -- > Patrick McElhaney > 704.560.9117 > http://pmcelhaney.blogspot.com > > > ---------------------------------------------------------- > 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]
