hairbo
hairbo

Reputation: 3163

Directly accessing application.cfc produces untrapped ColdFusion error

I'm developing a new ColdFusion 9 application using application.cfc, and just for kicks I wanted to see what happens if I navigate directly to application.cfc, like this:

http://www.mysite.com/application.cfc

I was somewhat surprised to see an untrapped error, the meat of which is:

"Invalid request of Application.cfm, Application.cfc, or OnRequestEnd.cfm file"

After some digging around, it appears that there's no real way to handle this within the application itself--or at least no way that I've found thus far.

Are there any decent solutions for this problem out there?

Thanks in advance!

Upvotes: 2

Views: 588

Answers (2)

Adam Cameron
Adam Cameron

Reputation: 29870

Well, if you don't want to use the site-wide error handler, you could simply make the Application.cfc not web browseable, then let your 404-handler deal with it.

Upvotes: 1

Shawn Holmes
Shawn Holmes

Reputation: 3762

The answer is to use the global error handler via ColdFusion Administrator:

enter image description here

Here, you'll enter in the value of a cf template that you build, and trap the necessary errors that come in as a result of direct access to Application.cfc.

Upvotes: 5

Related Questions