todo list
[scpubgit/App-EzPz.git] / lib / Email / EzPz / ListCore.pm
index b91517d..3cef09e 100644 (file)
@@ -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 {