Reputation: 3163
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
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
Reputation: 3762
The answer is to use the global error handler via ColdFusion Administrator:
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