X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FApp-EzPz.git;a=blobdiff_plain;f=lib%2FEmail%2FEzPz%2FListCore.pm;fp=lib%2FEmail%2FEzPz%2FListCore.pm;h=3cef09e60663a28f9cf1e8cf3d5aa6f82ac0381e;hp=b91517de5ffbefde4c0735f9c157ec9e45917036;hb=0a0e9549e16b04188b7763226208c69f53d78149;hpb=fb960e0eb2ad6ad19c2c695b6aa87716ae299a23 diff --git a/lib/Email/EzPz/ListCore.pm b/lib/Email/EzPz/ListCore.pm index b91517d..3cef09e 100644 --- a/lib/Email/EzPz/ListCore.pm +++ b/lib/Email/EzPz/ListCore.pm @@ -2,6 +2,7 @@ package Email::EzPz::ListCore; use Moo::Role; use IO::All; +use Capture::Tiny qw(capture_merged); use IPC::System::Simple qw(run capture); has list_dir => (is => 'ro', required => 1); @@ -31,7 +32,12 @@ sub _command_args { sub _call_command { my ($self, @cmd) = @_; - run $self->_command_args(@cmd); + my $ok; + my $out = capture_merged { + $ok = eval { run $self->_command_args(@cmd); 1 }; + }; + die "Command failed: $out\n" unless $ok; + return; } sub _capture_command {