Error Handling in CFSCRIPT

Reply

Join Date: Jun 2003
Posts: 313
Reputation: red_evolve is on a distinguished road 
Solved Threads: 0
red_evolve's Avatar
red_evolve red_evolve is offline Offline
Posting Whiz

Error Handling in CFSCRIPT

 
0
  #1
Jul 4th, 2005
Greetings.
I would like to know if there's any way that I could throw errors within a cfscript block. I have checked the Coldfusion manual, but there are only the try and catch block stated, not the throw function.
Please advise.
"Study the past if you would define the future" - Confucius
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 69
Reputation: bkendall is an unknown quantity at this point 
Solved Threads: 0
bkendall's Avatar
bkendall bkendall is offline Offline
Junior Poster in Training

Re: Error Handling in CFSCRIPT

 
0
  #2
Jul 5th, 2005
you should be able to use <cfthrow> inside the <cfcatch> block
Reply With Quote Quick reply to this message  
Join Date: Jun 2003
Posts: 313
Reputation: red_evolve is on a distinguished road 
Solved Threads: 0
red_evolve's Avatar
red_evolve red_evolve is offline Offline
Posting Whiz

Re: Error Handling in CFSCRIPT

 
0
  #3
Jul 7th, 2005
I meant, what can I use to throw errors inside functions.
  1. <cfscript>
  2. function foo(){
  3. if(x == 0)
  4. // throw error
  5. }
  6. </cfscript>
"Study the past if you would define the future" - Confucius
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 69
Reputation: bkendall is an unknown quantity at this point 
Solved Threads: 0
bkendall's Avatar
bkendall bkendall is offline Offline
Junior Poster in Training

Re: Error Handling in CFSCRIPT

 
0
  #4
Jul 7th, 2005
Sorry I misunderstood your question there. I have mostly used error tags inside of <cfset>
Reply With Quote Quick reply to this message  
Join Date: Jun 2003
Posts: 313
Reputation: red_evolve is on a distinguished road 
Solved Threads: 0
red_evolve's Avatar
red_evolve red_evolve is offline Offline
Posting Whiz

Re: Error Handling in CFSCRIPT

 
0
  #5
Jul 11th, 2005
It's okay
Still waiting for someone who could help me with this.
"Study the past if you would define the future" - Confucius
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 1
Reputation: guy_richardson is an unknown quantity at this point 
Solved Threads: 0
guy_richardson guy_richardson is offline Offline
Newbie Poster

Re: Error Handling in CFSCRIPT

 
0
  #6
Mar 23rd, 2006
Originally Posted by red_evolve
It's okay
Still waiting for someone who could help me with this.
Has been a while... but if you're still stuck you could try this.... Works for me on CF7.

<cffunction name="throw">
<cfargument name="message">
<cfthrow message="#arguments.message#">
</cffunction>

<cfscript>
throw("Error message here!");
</cfscript>
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC