|
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
cftry - catch - just to be sure I understand
I've got to start implementing better error trapping in my applications.Les Mizzell 07/08/08 05:47 P I usually like to add a type:William Seiter 07/08/08 11:13 P 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> 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> :: :: :: :: :: :: :: :: :: ::
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||