Yes and Thank You Luis it was great hint, the issue in our code I mean setting works perfect and then method from our error handler is called. But in this method we use Event.setValue(...), Event.setLayout(...), Enet.setView(...) and it seems that somewhere here is a problem. I will check this deeper at Monday.
Agh ok. Yes in the exception handler you cannot set views for rendering or use render data. This is special because more things could go wrong. Therefore the handler runs and the framework will then show the error template or the custom error template of your choice.
This is done in more simplicity to avoid nested errors
It was implemented for our project some time ago and works for non existingevents / wrong events like [index.cfm?event=test.check].
Pobably this is why we weren't able to find the problem at the beggining.
So do You suggest to change this error handler ?
If Yes can You advise what would be the best approach to show error page. Relocate to other event maybe ?
Well, the exception handler intercepts final exceptions in the app. You can have more granular control by creating an onError() function in your handlers. This will handle errors at that handler or base handler level where eyou can use setView and renderdata(). http://wiki.coldbox.org/wiki/EventHandlers.cfm#onError_convention
If the exception bubbles up then the exception handler traps it or the onException interceptor. This means something really bad went on and there will be no rendering or views set. You take care of the exception and then the custom error template will be shown or the default coldbox error template.
Thank You for both suggests, as the discussion evolved I decided to use my VPN to check it
Because I need to show custom views and texts for localization it seems I can't use customErrorTemplate.
But it looks like that in this particular case methods I wrote about before can't handle value with ':' for Event.event structure.
So my quick fix was to check if this sructre contains : If true I used setNextEvent relocating to the same method in same event,
so the Event.event structure has a value of previous event which is always correct.
What do You think about this ?