Invalid event vs Page Not Found

In my coldbox config I have the following

missingTemplateHandler = “main.pageNotFound”

onInvalidEvent = “main.onInvalidEvent”

In my main controller I have the following methods

public void function onInvalidEvent(){
logbox.warn("Invalid Event: " & rc.event);

public void function pageNotFound(event){
logbox.warn(“Page Not Found:”);
event.renderData(data=renderView(‘pageNotFound’),statusCode=404,statusMessage=“Page Not Found!”);

What I want to do here is do some logging when pages or events are not found. If I visit /foo I will see the following in the logs which is great

“WARN”,“TOYSFORSHOTS”,“09/15/2011”,“13:16:16”,“ROOT”,“Invalid Event: foo.index”

But when I visit /foo.cfm I see the following. The important thing is my pageNotFound is never called and therefor the 404 status code is never thrown.

“WARN”,“TOYSFORSHOTS”,“09/15/2011”,“12:36:04”,“coldbox.system.interceptors.SES”,“Invalid Extension Detected: cfm detected but it is not in the valid extension list: json,jsont,xml,html,htm,rss”
“WARN”,“TOYSFORSHOTS”,“09/15/2011”,“12:36:04”,“ROOT”,“Invalid Event: foo.cfm.index”

Am I doing something wrong? I would think this should throw a pageNotFound but its not working as I would expect.

Dan, I think the problem is that the onError in Application.cfc is not calling the ColdBox interceptor event.

Is it throwing a ColdBox error or an IIS/Apache error?

Make sure the application.cfc has the missing
Template handler delegating to coldbox

Luis Majano
Ortus Solutions, Corp
Toll free phone/fax: 1-888-557-8057
Mobile: 909-248-3408