From a630db1703bd30b2258149fc9a00c7c4f4a88531 Mon Sep 17 00:00:00 2001 From: Matt Hanna Date: Tue, 31 Jan 2012 11:58:21 -0500 Subject: [PATCH] Oops...HierarchicalMicroScheduler was transforming any exception from the walker level into a ReviewedStingException. Thanks to Ryan for pointing this out. --- .../gatk/executive/HierarchicalMicroScheduler.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/gatk/executive/HierarchicalMicroScheduler.java b/public/java/src/org/broadinstitute/sting/gatk/executive/HierarchicalMicroScheduler.java index eec440820..433c7d82f 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/executive/HierarchicalMicroScheduler.java +++ b/public/java/src/org/broadinstitute/sting/gatk/executive/HierarchicalMicroScheduler.java @@ -11,6 +11,7 @@ import org.broadinstitute.sting.gatk.io.ThreadLocalOutputTracker; import org.broadinstitute.sting.gatk.walkers.TreeReducible; import org.broadinstitute.sting.gatk.walkers.Walker; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; +import org.broadinstitute.sting.utils.exceptions.StingException; import org.broadinstitute.sting.utils.threading.ThreadPoolMonitor; import java.util.Collection; @@ -101,7 +102,7 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar while (isShardTraversePending() || isTreeReducePending()) { // Check for errors during execution. if(hasTraversalErrorOccurred()) - throw new ReviewedStingException("An error has occurred during the traversal.",getTraversalError()); + throw getTraversalError(); // Too many files sitting around taking up space? Merge them. if (isMergeLimitExceeded()) @@ -344,10 +345,15 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar return error != null; } - private synchronized Throwable getTraversalError() { + private synchronized StingException getTraversalError() { if(!hasTraversalErrorOccurred()) throw new ReviewedStingException("User has attempted to retrieve a traversal error when none exists"); - return error; + + // If the error is already a StingException, pass it along as is. Otherwise, wrap it. + if(error instanceof StingException) + return (StingException)error; + else + return new ReviewedStingException("An error occurred during the traversal.",error); } /**