[Bast-commits] r4329 - trunk/Devel-REPL/lib/Devel/REPL/Plugin

nothingmuch at dev.catalyst.perl.org nothingmuch at dev.catalyst.perl.org
Mon May 5 19:44:01 BST 2008


Author: nothingmuch
Date: 2008-05-05 19:44:01 +0100 (Mon, 05 May 2008)
New Revision: 4329

Modified:
   trunk/Devel-REPL/lib/Devel/REPL/Plugin/Peek.pm
Log:
update Plugin::Peek for error object

Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/Peek.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/Peek.pm	2008-05-05 18:41:35 UTC (rev 4328)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/Peek.pm	2008-05-05 18:44:01 UTC (rev 4329)
@@ -12,11 +12,16 @@
 sub expr_command_peek {
   my ( $self, $eval, $code ) = @_;
 
-  # can't override output properly
-  # FIXME do some dup wizardry
-  Dump( $self->eval($code) );
+  my @res = $self->eval($code);
 
-  return ""; # this is a hack to print nothing after Dump has already printed. PLZ TO FIX KTHX!
+  if ( $self->is_error(@res) ) {
+    return $self->format(@res);
+  } else {
+    # can't override output properly
+    # FIXME do some dup wizardry
+    Dump(@res);
+    return ""; # this is a hack to print nothing after Dump has already printed. PLZ TO FIX KTHX!
+  }
 }
 
 __PACKAGE__




More information about the Bast-commits mailing list