Commit 02cd9284 authored by Andy Yates's avatar Andy Yates
Browse files

Improving error reporting hopefully

parent 1dfa5820
...@@ -106,7 +106,9 @@ sub index_file { ...@@ -106,7 +106,9 @@ sub index_file {
$self->param('program'), $file, $target_file); $self->param('program'), $file, $target_file);
$self->info('About to run "%s"', $cmd); $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: $!"; 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 #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 { ...@@ -100,7 +100,9 @@ sub index_file {
$self->param('program'), $molecule_arg, $silence, $target_file, $file); $self->param('program'), $molecule_arg, $silence, $target_file, $file);
$self->info('About to run "%s"', $cmd); $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: $!"; unlink $file or throw "Cannot remove the file '$file' from the filesystem: $!";
$self->param('index_base', $target_file); $self->param('index_base', $target_file);
return; return;
......
Markdown is supported
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