[coldbox:16578] Problem with module event executions

Have you used the onInvalidEvent setting

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano

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.

Regards,
Bartek

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 ?

Regards, Bartek

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.

Those are your choices.

signature0.jpg

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Thank You for both suggests, as the discussion evolved I decided to use my VPN to check it :slight_smile:
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 ?

Regards, Bartek

You could always listen for the interception error point for handlers, if that makes it easier for you.