From: nothingmuch Date: Mon, 5 May 2008 18:44:01 +0000 (+0000) Subject: update Plugin::Peek for error object X-Git-Tag: v1.003015~123 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=commitdiff_plain;h=213b6e768d5a81a0c9e37eabde0d5d352b49db72 update Plugin::Peek for error object git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@4329 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/lib/Devel/REPL/Plugin/Peek.pm b/lib/Devel/REPL/Plugin/Peek.pm index f9bb3ed..8e772ee 100644 --- a/lib/Devel/REPL/Plugin/Peek.pm +++ b/lib/Devel/REPL/Plugin/Peek.pm @@ -12,11 +12,16 @@ with qw(Devel::REPL::Plugin::Turtles); sub expr_command_peek { my ( $self, $eval, $code ) = @_; - # can't override output properly - # FIXME do some dup wizardry - Dump( $self->eval($code) ); - - return ""; # this is a hack to print nothing after Dump has already printed. PLZ TO FIX KTHX! + my @res = $self->eval($code); + + 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__