# Remember to update this in Catalyst::Runtime as well!
-our $VERSION = '5.90059_005';
+our $VERSION = '5.90063';
sub import {
my ( $class, @arguments ) = @_;
$class->setup_log( delete $flags->{log} );
$class->setup_plugins( delete $flags->{plugins} );
- # Call plugins setup, this is stupid and evil.
- # Also screws C3 badly on 5.10, hack to avoid.
- {
- no warnings qw/redefine/;
- local *setup = sub { };
- $class->setup unless $Catalyst::__AM_RESTARTING;
- }
-
- $class->setup_middleware();
$class->setup_data_handlers();
$class->setup_dispatcher( delete $flags->{dispatcher} );
if (my $engine = delete $flags->{engine}) {
EOF
}
+ # Call plugins setup, this is stupid and evil.
+ # Also screws C3 badly on 5.10, hack to avoid.
+ {
+ no warnings qw/redefine/;
+ local *setup = sub { };
+ $class->setup unless $Catalyst::__AM_RESTARTING;
+ }
+
+ $class->setup_middleware();
+
# Initialize our data structure
$class->components( {} );
# 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 $class || 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
my $last = pop( @{ $c->stack } );
if ( my $error = $@ ) {
+ #rethow if this can be handled by middleware
+ if(blessed $error && ($error->can('as_psgi') || $error->can('code'))) {
+ $error->can('rethrow') ? $error->rethrow : croak $error;
+ }
if ( blessed($error) and $error->isa('Catalyst::Exception::Detach') ) {
$error->rethrow if $c->depth > 1;
}
$c->dispatch;
$status = $c->finalize;
} catch {
- chomp(my $error = $_);
- $class->log->error(qq/Caught exception in engine "$error"/);
#rethow if this can be handled by middleware
- if(blessed $error && ($error->can('as_psgi') || $error->can('code'))) {
- $error->can('rethrow') ? $error->rethrow : croak $error;
+ if(blessed $_ && ($_->can('as_psgi') || $_->can('code'))) {
+ $_->can('rethrow') ? $_->rethrow : croak $_;
}
+ chomp(my $error = $_);
+ $class->log->error(qq/Caught exception in engine "$error"/);
};
$COUNT++;