944,127 Members | Top Members by Rank

Ad:
  • ColdFusion Discussion Thread
  • Unsolved
  • Views: 6599
  • ColdFusion RSS
Jul 4th, 2005
0

Error Handling in CFSCRIPT

Expand Post »
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.
Similar Threads
Reputation Points: 53
Solved Threads: 1
Posting Whiz
red_evolve is offline Offline
313 posts
since Jun 2003
Jul 5th, 2005
0

Re: Error Handling in CFSCRIPT

you should be able to use <cfthrow> inside the <cfcatch> block
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
bkendall is offline Offline
69 posts
since Jul 2005
Jul 7th, 2005
0

Re: Error Handling in CFSCRIPT

I meant, what can I use to throw errors inside functions.
ColdFusion Syntax (Toggle Plain Text)
  1. <cfscript>
  2. function foo(){
  3. if(x == 0)
  4. // throw error
  5. }
  6. </cfscript>
Reputation Points: 53
Solved Threads: 1
Posting Whiz
red_evolve is offline Offline
313 posts
since Jun 2003
Jul 7th, 2005
0

Re: Error Handling in CFSCRIPT

Sorry I misunderstood your question there. I have mostly used error tags inside of <cfset>
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
bkendall is offline Offline
69 posts
since Jul 2005
Jul 11th, 2005
0

Re: Error Handling in CFSCRIPT

It's okay
Still waiting for someone who could help me with this.
Reputation Points: 53
Solved Threads: 1
Posting Whiz
red_evolve is offline Offline
313 posts
since Jun 2003
Mar 23rd, 2006
0

Re: Error Handling in CFSCRIPT

Quote 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>
Reputation Points: 10
Solved Threads: 0
Newbie Poster
guy_richardson is offline Offline
1 posts
since Mar 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ColdFusion Forum Timeline: Stopping entries into database
Next Thread in ColdFusion Forum Timeline: Show Numbers of Deleted entries from database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC