Easiest Way to Generate a Request Error

I ran into a situation today where I wanted to create a request errorin ColdFusion MX 7, to test handling request errors. My problem: How do you generate a request error?

My solution:

  • Create a test.page with the code <cfset undefvar= undefvar/>
  • In my application.cfc, create a <cferror /> tag and point it to error.cfm.
  • In error.cfm add code <cfset undefvar= undefvar/>

And that should do it. Is there an easier way that I’m missing?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s