House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Search cf-talk

July 03, 2009

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Home /  Groups /  ColdFusion Talk (CF-Talk)

cftry - catch - just to be sure I understand

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Les Mizzell
07/08/2008 05:47 PM

I've got to start implementing better error trapping in my applications. Just to be sure I've got my head around this right... "myEmailLIST" has already been validated TWICE, using two different methods, but invariably, there's always one address somewhere that gets through validation that will still choke cfmail. The code below will allow the loop to run from beginning to end, without stopping, and build a list of the email addresses that caused the cfmail tag to error. Basically, I need to to *not* throw an error, but note an exception and then continue processing the remainder of the list normally wiithout stopping, correct? <cfloop query="myEmailLIST">   <cftry>        <!--- CFMAIL CODE TO SEND HERE --->     <cfcatch>        <!--- CODE TO BUILD EXCEPTION EMAIL LIST HERE --->     </cfcatch>   </cftry> </cfloop>

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
William Seiter
07/08/2008 11:13 PM

I usually like to add a type: <cfloop query="myEmailLIST">   <cftry>        <!--- CFMAIL CODE TO SEND HERE --->     <cfcatch type="any">        <!--- CODE TO BUILD EXCEPTION EMAIL LIST HERE --->     </cfcatch>   </cftry> </cfloop> ---------------------------------- William Seiter ColdFusion Web Developer / Consultant http://william.seiter.com Free Website Trade Publication >> Website Magazine http://www.websitemagazine.com/referrals/?id=51344&f=text2 Don't forget to answer the survey questions, it's a 10 second task , a very small request  for access to this  incredible resource. Have you ever read a book that changed your life? Go to: http://www.winninginthemargins.com Use PassKey: GoldenGrove You'll be glad you did. ::-----Original Message----- :: ::Sent: Tuesday, July 08, 2008 2:47 PM ::To: CF-Talk ::Subject: cftry - catch - just to be sure I understand :: :: ::I've got to start implementing better error trapping in my applications. ::Just to be sure I've got my head around this right... :: ::"myEmailLIST" has already been validated TWICE, using two different ::methods, but invariably, there's always one address somewhere that gets ::through validation that will still choke cfmail. :: ::The code below will allow the loop to run from beginning to end, without ::stopping, and build a list of the email addresses that caused the cfmail ::tag to error. Basically, I need to to *not* throw an error, but note an ::exception and then continue processing the remainder of the list ::normally wiithout stopping, correct? :: :: ::<cfloop query="myEmailLIST"> ::  <cftry> ::       <!--- CFMAIL CODE TO SEND HERE ---> ::    <cfcatch> ::       <!--- CODE TO BUILD EXCEPTION EMAIL LIST HERE ---> ::    </cfcatch> ::  </cftry> ::</cfloop> :: :: :: :: :: :: :: :: :: ::


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists