Re: [Catalyst] Chained and exceptions
On 9 May 2013, at 14:25, Bill Moseley mose...@hank.org wrote: I have a feeling I asked this before, but cannot find the post. [info] Exception powered by Catalyst 5.90030 What's the reasoning that chained actions continue to run after an earlier exception? You're after this: https://metacpan.org/module/Catalyst::ActionRole::DetachOnDie which gives you the alternate behaviour (i.e. detaching from the chain on first exception). Cheers t0m ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Chained and exceptions
On Fri, May 10, 2013 at 1:29 AM, Tomas Doran bobtf...@bobtfish.net wrote: You're after this: https://metacpan.org/module/Catalyst::ActionRole::DetachOnDie which gives you the alternate behaviour (i.e. detaching from the chain on first exception). We have a number of applications, a few quite large, where some controllers inherit from different base classes. We could try and retro fit all existing code, but it would be a good-sized project. So the monkey patch we did (as well as Dami Laurent had done in 2008http://lists.scsys.co.uk/pipermail/catalyst/2008-March/017789.html) is better for us. I'm pretty sure this issue is not well known amongst our current (and future) developers and thus it's quite likely someone would forget this in a new Controller. We all understand that an uncaught exception should not bring down the server and instead generate a 500, but I think few would assume that when using Chained an exception would not stop the request dead in its tracks and instead is implicitly trapped and allowed to continue. I think the more likely situation now is code running when it is not expected -- which could be a serious security issue if the earlier action in a chain is used for access control. What would the developers think of deprecating this behavior (for the few that might actually be relying on this) and issue a warning if a config option is not set that fixes the issue? -- Bill Moseley mose...@hank.org ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Chained and exceptions
On 5/10/13 10:10 AM, Bill Moseley wrote: What would the developers think of deprecating this behavior (for the few that might actually be relying on this) and issue a warning if a config option is not set that fixes the issue? +1 I have lots of ugly code that checks for $c-error in order to break chains. Not having to do that, or making it configurable, would be nice. -- Peter Karman . http://peknet.com/ . pe...@peknet.com ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Re: Chained and exceptions
* Bill Moseley mose...@hank.org [2013-05-10 17:15]: What would the developers think of deprecating this behavior (for the few that might actually be relying on this) and issue a warning if a config option is not set that fixes the issue? I’ll second that, I’d love to drop some more unbreak-me boilerplate. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: Chained and exceptions
We should make it a config variable that defaults to the old behaviour but adjust -Devel to default it to true in new apps. This keeps back compat, but makes new apps behave 'correctly'. +1 from me. t0m Aristotle Pagaltzis pagalt...@gmx.de wrote: * Bill Moseley mose...@hank.org [2013-05-10 17:15]: What would the developers think of deprecating this behavior (for the few that might actually be relying on this) and issue a warning if a config option is not set that fixes the issue? I’ll second that, I’d love to drop some more unbreak-me boilerplate. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/