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

No Error Struct from CFCATCH

Participant ,
Mar 17, 2011 Mar 17, 2011

Hello,

I am having some weird issues with CFTRY/CFCATCH. I am getting an error that says, "Variable ERROR is undefined" when I run the following code. Why isn't my Error Struct available to dump like it normall is?

Var 'test' is not defined so it should throw an error.

<cfoutput>
    <cftry>
        #trim(test)#
        <cfcatch>
            <cfdump var="#error#">
        </cfcatch>
    </cftry>
</cfoutput>

1.3K
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

correct answers 1 Correct answer

Valorous Hero , Mar 17, 2011 Mar 17, 2011

No, I think you are just mixing the two. Error handling pages have always been different than cfcatch.

http://livedocs.adobe.com/coldfusion/8/Tags_d-e_11.html#2022557

Translate
Participant ,
Mar 17, 2011 Mar 17, 2011

hmmm

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
Valorous Hero ,
Mar 17, 2011 Mar 17, 2011

You are using the wrong structure name. Dump CFCATCH not ERROR.

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 ,
Mar 17, 2011 Mar 17, 2011

Did that just change?

All the other tags on our error handler page reference error.something and it works fine. All of a sudden that doesn't work and I need to use cfcatch.something???

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
Valorous Hero ,
Mar 17, 2011 Mar 17, 2011

No, I think you are just mixing the two. Error handling pages have always been different than cfcatch.

http://livedocs.adobe.com/coldfusion/8/Tags_d-e_11.html#2022557

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 ,
Mar 17, 2011 Mar 17, 2011
LATEST

That is exactly what I was doing. I was mixing up CFCATCH with CFERROR.

Thank you for setting me straight!!!

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