Skip to main content
Inspiring
March 17, 2011
Answered

No Error Struct from CFCATCH

  • March 17, 2011
  • 2 replies
  • 1383 views

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>

    This topic has been closed for replies.
    Correct answer -__cfSearching__-

    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

    2 replies

    Inspiring
    March 17, 2011

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

    jbreslowAuthor
    Inspiring
    March 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???

    -__cfSearching__-Correct answer
    Inspiring
    March 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

    jbreslowAuthor
    Inspiring
    March 17, 2011

    hmmm