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.

you should be able to use <cfthrow> inside the <cfcatch> block

I meant, what can I use to throw errors inside functions.

<cfscript>
  function foo(){
    if(x == 0)
      // throw error
  }
</cfscript>

Sorry I misunderstood your question there. I have mostly used error tags inside of <cfset>

It's okay :)
Still waiting for someone who could help me with this.

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>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.