User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 427,758 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,705 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser: Programming Forums
Views: 4431 | Replies: 5
Reply
Join Date: Jun 2003
Location: Malaysia
Posts: 313
Reputation: red_evolve is on a distinguished road 
Rep Power: 6
Solved Threads: 0
red_evolve's Avatar
red_evolve red_evolve is offline Offline
Posting Whiz

Error Handling in CFSCRIPT

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2005
Posts: 69
Reputation: bkendall is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
bkendall's Avatar
bkendall bkendall is offline Offline
Junior Poster in Training

Re: Error Handling in CFSCRIPT

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

Re: Error Handling in CFSCRIPT

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

Re: Error Handling in CFSCRIPT

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

Re: Error Handling in CFSCRIPT

  #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  
Join Date: Mar 2006
Posts: 1
Reputation: guy_richardson is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
guy_richardson guy_richardson is offline Offline
Newbie Poster

Re: Error Handling in CFSCRIPT

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ColdFusion Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ColdFusion Forum

All times are GMT -4. The time now is 1:02 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC