diff --git a/public/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java b/public/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java index bc4c181be..870492e42 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java +++ b/public/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java @@ -35,6 +35,7 @@ import org.broadinstitute.sting.gatk.arguments.GATKArgumentCollection; import org.broadinstitute.sting.gatk.refdata.tracks.FeatureManager; import org.broadinstitute.sting.gatk.walkers.Attribution; import org.broadinstitute.sting.gatk.walkers.Walker; +import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.help.*; import org.broadinstitute.sting.utils.text.TextFormattingUtils; @@ -120,9 +121,13 @@ public class CommandLineGATK extends CommandLineExecutable { if ( message.indexOf("Too many open files") != -1 ) exitSystemWithUserError(new UserException.TooManyOpenFiles()); - // Malformed BAM looks like a SAM file + // malformed BAM looks like a SAM file if ( message.indexOf("Cannot use index file with textual SAM file") != -1 ) exitSystemWithSamError(t); + + // can't close tribble index when writing + if ( message.indexOf("Unable to close index for") != -1 ) + exitSystemWithUserError(new UserException(t.getCause().getMessage())); } /** diff --git a/public/java/src/org/broadinstitute/sting/gatk/executive/ShardTraverser.java b/public/java/src/org/broadinstitute/sting/gatk/executive/ShardTraverser.java index 9920213a3..bb0344848 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/executive/ShardTraverser.java +++ b/public/java/src/org/broadinstitute/sting/gatk/executive/ShardTraverser.java @@ -6,11 +6,11 @@ import org.broadinstitute.sting.gatk.datasources.providers.ShardDataProvider; import org.broadinstitute.sting.gatk.datasources.reads.Shard; import org.broadinstitute.sting.gatk.io.ThreadLocalOutputTracker; import org.broadinstitute.sting.gatk.traversals.TraversalEngine; -import org.broadinstitute.sting.gatk.walkers.LocusWalker; import org.broadinstitute.sting.gatk.walkers.Walker; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; /** * User: hanna * Date: Apr 29, 2009 @@ -79,6 +79,10 @@ public class ShardTraverser implements Callable { microScheduler.reportShardTraverseTime(endTime-startTime); return accumulator; + } catch(Throwable t) { + // Notify that an exception has occurred + microScheduler.handleException(new ExecutionException(t)); + throw new RuntimeException(t); } finally { synchronized(this) { complete = true;