My exception handler is “ehMain.onException”. As such, I have the following line in my config file:
exceptionHandler = “ehMain.onException”,
You are not supposed to call the exception handler directly. For instance, if you are typing the following in your web browser: http://www.mysite.com/index.cfm/ehMain/onException
then you’re doing it wrong. That will surely error because there is no exception bean in the request collection.
If you want to test your exception handler, then you need to purposely create an error in another, real handler and ColdBox will automatically call the exception handler for you and it will pass in the exception bean.
Hi,
Check you rc by writedump(rc);writedump(prc); and find out ExceptionBean. This error normally occur because ExceptionBean is not available neither rc nor prc.
It is actually present as exception in prc.
So right code should be prc.exception.getMessage() and you can use other function of prc.exception…