Skip to content
Snippets Groups Projects
Commit 02cd9284 authored by Andy Yates's avatar Andy Yates
Browse files

Improving error reporting hopefully

parent 1dfa5820
No related branches found
No related tags found
No related merge requests found
......@@ -106,7 +106,9 @@ sub index_file {
$self->param('program'), $file, $target_file);
$self->info('About to run "%s"', $cmd);
system($cmd) and throw "Cannot run program '$cmd'";
my $output = `$cmd 2>&1`;
my $rc = $? >> 8;
throw "Cannot run program '$cmd'. Return code was ${rc}. Program output was $output" if $rc;
unlink $file or throw "Cannot remove the file '$file' from the filesystem: $!";
#Check the file size. If it's 16 bytes then reject as that is an empty file for 2bit
......
......@@ -100,7 +100,9 @@ sub index_file {
$self->param('program'), $molecule_arg, $silence, $target_file, $file);
$self->info('About to run "%s"', $cmd);
system($cmd) and throw sprintf("Cannot run program '%s' with exit code %d", $cmd, ($? >> 8));
my $output = `$cmd 2>&1`;
my $rc = $? >> 8;
throw "Cannot run program '$cmd'. Return code was ${rc}. Program output was $output" if $rc;
unlink $file or throw "Cannot remove the file '$file' from the filesystem: $!";
$self->param('index_base', $target_file);
return;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment