NAME
Catalyst::Plugin::MortalForward - Make forward() to throw exception
SYNOPSIS
use Catalyst qw( MortalForward );
sub someaction : Local {
...
$c->forward('check_input'); # may die
# never executed if forward dies
do_something_important(); # assume that the input has been checked
}
DESCRIPTION
Catalyst::Plugin::MortalForward is a small plugin that changes the behaviour of $c->forward
which usually never dies (because the forwarded code is internally wrapped into an eval block.
This plugin changes this behaviour globally. The forward method will throw exceptions (that you should be carefull to handle at somepoint or the default Catalyst error page will be displayed)
SEE ALSO
Discussion on the Catalyst mailing list: http://lists.rawmode.org/pipermail/catalyst/2006-January/004874.html (followed-up in February)
BUGS & TODOS
Please report any problem. If you let the exception reach Catalyst internal, then the error (which is logged might be a bit messy) because it holds the information of all successive layers that the exception went thru. For instance :
Caught exception in TestApp->class_fwd "Caught exception in TestApp::C::Elsewhere->test "I die too, sorry at /Users/yann/Catalyst/Catalyst-Plugin-MortalForward/t/lib/TestApp/C/Elsewhere.pm line 8." at lib/Catalyst/Plugin/MortalForward.pm line 24."
AUTHOR
Six Apart, cpan@sixapart.com
LICENSE
Catalyst::Plugin::MortalForward is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR & COPYRIGHT
Except where otherwise noted, Catalyst::Plugin::MortalForward is Copyright 2006 Six Apart, cpan@sixapart.com. All rights reserved.