[Catalyst] Fatal errors in chained actions

Dami Laurent (PJ) laurent.dami at justice.ge.ch
Fri Apr 8 09:39:16 GMT 2011


>-----Message d'origine-----
>De : Ronald J Kimball [mailto:rkimball at pangeamedia.com]
>Envoyé : jeudi, 7. avril 2011 20:11
>À : The elegant MVC web framework
>Objet : [Catalyst] Fatal errors in chained actions
>
>I was surprised to discover that when a chained action throws a fatal
>error, Catalyst continues executing the remaining actions in the
>chain.  Personally, I had assumed that each action in the chain could
>depend on the preceeding actions having been executed successfully.

Hi Ronald,

This point was discussed in 2008 : see
http://lists.scsys.co.uk/pipermail/catalyst/2008-March/017748.html
and the rest of the thread.

At that time I also had some IRC chats or private e-mails with Matt Trout about this point; he of course suggested me to write a patch ... which I never did ! 
The problem we discussed was that a change of behaviour would perhaps break some stuff in existing applications; so what is probably needed is a parameter somewhere in Catalyst config to tune the error handling for chained actions.

For the moment, what I do in my applications is quite bad : load Catalyst::ActionChain and forcefully overwrite the dispatch() method, applying the code change proposed in 
http://lists.scsys.co.uk/pipermail/catalyst/2008-March/017789.html
I really need that hack because, as you mention, if a database call fails in the first URL segment, we better stop there instead of applying the following segments.

So maybe it's time to really think about proposing a patch to Catalyst ...

Best regards, Laurent Dami




More information about the Catalyst mailing list