Hi, I’m migrating an application from ColdBox 3.8 to Coldbox 4, running on ColdFusion 9.01, and in some handler I have the onError event.
When I run any Handler that contains this onError event, I get an error “CFCATCH is undefined”.
I found that in coldbox.system.web.Controller in the function _runEvent is this block of code
} catch( any e ){
if( oHandler._actionExists( “onError” ) ){
loc.results = oHandler.onError(
event = oRequestContext,
rc = args.rc,
prc = args.prc,
faultAction = ehBean.getmethod(),
exception = cfcatch,
eventArguments = arguments.eventArguments);
} else {
rethrow;
}
}
On line 632 is “exception = cfcatch” so I changed it for "exception = e ", and that solved the issue.
} catch( any e ){
if( oHandler._actionExists( “onError” ) ){
loc.results = oHandler.onError(
event = oRequestContext,
rc = args.rc,
prc = args.prc,
faultAction = ehBean.getmethod(),
exception = e,
eventArguments = arguments.eventArguments);
} else {
rethrow;
}
}
I hope this can help, thanks.
Angel Torres.