X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=33a5a6104ee539c694aaad24e9f689e91b88afe2;hb=26b4280142e85f17f95802bb0f409590f192a49f;hp=0eee708fe9ff96ef772817c4c0266a1451930bda;hpb=79070bc658ced79555a17ee2b4a84269c4d32de0;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 0eee708..33a5a61 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -126,7 +126,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90059_004'; +our $VERSION = '5.90059_006'; sub import { my ( $class, @arguments ) = @_; @@ -1254,7 +1254,7 @@ EOF # Should be the last thing we do so that user things hooking # setup_finalize can log.. $class->log->_flush() if $class->log->can('_flush'); - return 1; # Explicit return true as people have __PACKAGE__->setup as the last thing in their class. HATE. + return $class || 1; # Just in case someone named their Application 0... } =head2 $app->setup_finalize @@ -3436,6 +3436,28 @@ C - See L. =back +=head1 EXCEPTIONS + +Generally when you throw an exception inside an Action (or somewhere in +your stack, such as in a model that an Action is calling) that exception +is caught by Catalyst and unless you either catch it yourself (via eval +or something like L or by reviewing the L stack, it +will eventually reach L and return either the debugging +error stack page, or the default error page. However, if your exception +can be caught by L, L will +instead rethrow it so that it can be handled by that middleware (which +is part of the default middleware). For example this would allow + + use HTTP::Throwable::Factory 'http_throw'; + + sub throws_exception :Local { + my ($self, $c) = @_; + + http_throw(SeeOther => { location => + $c->uri_for($self->action_for('redirect')) }); + + } + =head1 INTERNAL ACTIONS Catalyst uses internal actions like C<_DISPATCH>, C<_BEGIN>, C<_AUTO>, @@ -3939,7 +3961,7 @@ Upasana =head1 COPYRIGHT -Copyright (c) 2005, the above named PROJECT FOUNDER and CONTRIBUTORS. +Copyright (c) 2005-2014, the above named PROJECT FOUNDER and CONTRIBUTORS. =head1 LICENSE