Skip to main content
Inspiring
April 2, 2008
Question

cftry/cfcatch error

  • April 2, 2008
  • 2 replies
  • 373 views
I am getting an error from a page saying that cfcatch needs to be withing cftry tags, which is. I am assuming that somehow it's thinking that cftry tags are closing before they are. Here's my code:

<cftry>
<cfif not isXML(cfhttp.fileContent)>
<cfthrow message="The remote service did not return valid XML.">
</cfif>

<cfset xmlResult = xmlParse(cfhttp.fileContent)>
<cfif structKeyExists(xmlResult, "dataroot") and structKeyExists(xmlResult.dataroot,"jobs")>

<cfloop index="x" from="1" to="#arrayLen(xmlResult.dataroot.jobs)#">

<cfset node = xmlResult.dataroot.jobs>
<cfcatch></cfcatch>
</cftry>
<CFTRY>
    This topic has been closed for replies.

    2 replies

    TiGGiAuthor
    Inspiring
    April 3, 2008
    I am obviously blind, thanks!
    Inspiring
    April 2, 2008
    Your cfloop and cfif tags are not closed.

    See attached code