Question on using customErrorTemplate in Coldbox.cfc

I'm running ColdBox 3.5 Beta.

I'm trying to create a custom error handler with my sites' layout and
look and feel. My Layout has some dynamic pieces in it and uses
things like getSetting(), the "rc" scope, etc. In my ColdBox.cfc I
setup this:

exceptionHandler = "security.exception_event",
customErrorTemplate = "layouts/Layout.Error.cfm",

It seems though that the ColdBox variables beyond the exception bean
aren't available. My layout for my site requires certain variables to
be present but it looks like they aren't when an error is generated.

If that's the case, how can I create a nice error handler with a nice
look and feel? Do I have to essentially make somewhat of a static one
or am I doing something wrong?

Any help appreciated.

Thanks...

By the sounds of it you are letting the onError in Application.cfc kick in, which means that will be the case.

But not all is lost,

ColdBox allows for some real magic, so all you need to do is create an interceptor register and use something like the following.

/*************************************************************************************************
*************************************************************************************************/
public void function onException(event, interceptData) {
if(getSetting(“productionSystem”)) {

setNextEvent(‘general/notfound’);

}
}

/*************************************************************************************************
*************************************************************************************************/
public void function onInvalidEvent(event, interceptData) {
if(getSetting(“productionSystem”)) {

setNextEvent(‘general/notfound’);

}
}

/*************************************************************************************************
*************************************************************************************************/
public void function onMissingAction(event, interceptData) {
if(getSetting(“productionSystem”)) {

setNextEvent(‘general/notfound’);

}
}