Display version numbers of loaded plugins (Curtis Poe)
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index fa7ca6a..5f6d50b 100644 (file)
@@ -592,7 +592,9 @@ EOF
 
         {
             no strict 'refs';
-            @plugins = grep { /^Catalyst::Plugin/ } @{"$class\::ISA"};
+            @plugins = 
+                map  { $_ . ' ' . ( $_->VERSION || '' ) }
+                grep { /^Catalyst::Plugin/ } @{"$class\::ISA"};
         }
 
         if (@plugins) {
@@ -923,6 +925,7 @@ sub execute {
             push @{ $c->{stats} }, [ $action, sprintf( '%fs', $elapsed ) ];
         }
     }
+    my $last = ${ $c->stack }[-1];
     pop( @{ $c->stack } );
 
     if ( my $error = $@ ) {
@@ -931,7 +934,9 @@ sub execute {
         else {
             unless ( ref $error ) {
                 chomp $error;
-                $error = qq/Caught exception "$error"/;
+                my $class = $last->class;
+                my $name  = $last->name;
+                $error = qq/Caught exception in $class->$name "$error"/;
             }
             $c->error($error);
             $c->state(0);