I've been working with ColdFusion since 2000, and I've never heard of there being a built-in variable called "error". That's not to say it isn't so - just that I've never run across it in over 15 years of coding CF.
If the message is that "error" doesn't exist, then it does not exist. It must be created SOMEwhere before it can be used.
But the only way we can help you to understand what is going on is to view the code that is causing the issue. Can you post some of the code (in highlight, please) for us to review? One of us might see something that you are skipping over.
The syntax highlight is only available in the advanced editor.
I think the error scope only exists in the template module of the cferror tag -- and I'm not 100% sure it still exists as I don't use it anymore. Instead I define an onError function in my application.cfc and use the exception parameter:
<cffunction name="onError" returntype="void" output="true" access="public" hint="I am executed when an unhandled error occurs">
<cfargument name="exception" type="any" required="true" />
<cfargument name="eventName" type="string" required="true" />
<cfset local.template = "/error.cfm" />
<cfset request.exception = arguments.exception />
<cfoutput><cfinclude template="#local.template#" /></cfoutput>
<p>Something is really screwed up!</p>
<cfdump var="#cfcatch#" label="Secondary Error" />
<cfdump var="#request.exception#" label="Primary Error" />
In the above example I use "request.exception" where you would use "error".
Also note that I always put a try/catch block around my exception handler as CF does not react well to exceptions thrown within exception handlers. If this happens without the trap usually the most you will see is a Server 500 error with no hint of what failed.
Thanks WolfShade. I didn't realize that "error" wasn't a pre-defined variable in coldfusion. Based on Raymond Camden's tutorial and the CFerror Docs, I thought it was. But maybe that's only available within a particular template. Steve Sommer's suggestions are helping me get to the right place for now, so I'll hold off on posting code. Thanks for taking the time to review and help out!
Steve, Thanks for your help! Some of your comments/notes in the reply are helping me understand where I might be off -- I think I was relying on "error" that was set up in a template. For now, I've defined "Error" using your tip example: <cfset request.exception = arguments.exception />
Seems to be working for me. I'm going to test more and will mark as correct answer if I don't find any more issues. Thanks so much!