|| $args{'program'} ne $self->distance_program ) {
# We need to make a tree before we can return it.
my $dsub = 'run_' . $args{'program'};
- my( $ok, $result ) = $self->$dsub();
- if( $ok ) {
- # Save the resulting trees
- my $trees = parse_newick( $result );
- $self->_save_distance_trees( $trees );
- $self->distance_program( $args{'program'} );
- } else {
- throw( "Failed to calculate distance trees: $result" );
- }
+ my $result = $self->$dsub(); # this might throw an error - catch it?
+ # Save the resulting trees
+ my $trees = parse_newick( $result );
+ $self->_save_distance_trees( $trees );
+ $self->distance_program( $args{'program'} );
}
};
}
return join( '', @outtree ) if @outtree;
+ # If we got this far, we are about to throw an error.
my @error;
if( -f "$phylip_dir/outfile" ) {
open( OUTPUT, "$phylip_dir/outfile" ) or die "Could not open output for read";