Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cftry/cfcatch error

Participant ,
Apr 02, 2008 Apr 02, 2008
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>
380
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Apr 02, 2008 Apr 02, 2008
Your cfloop and cfif tags are not closed.

See attached code
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 03, 2008 Apr 03, 2008
LATEST
I am obviously blind, thanks!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources