Oops...HierarchicalMicroScheduler was transforming any exception from the walker level into a ReviewedStingException.

Thanks to Ryan for pointing this out.
This commit is contained in:
Matt Hanna 2012-01-31 11:58:21 -05:00
parent e7ace8efc4
commit a630db1703
1 changed files with 9 additions and 3 deletions

View File

@ -11,6 +11,7 @@ import org.broadinstitute.sting.gatk.io.ThreadLocalOutputTracker;
import org.broadinstitute.sting.gatk.walkers.TreeReducible; import org.broadinstitute.sting.gatk.walkers.TreeReducible;
import org.broadinstitute.sting.gatk.walkers.Walker; import org.broadinstitute.sting.gatk.walkers.Walker;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import org.broadinstitute.sting.utils.exceptions.StingException;
import org.broadinstitute.sting.utils.threading.ThreadPoolMonitor; import org.broadinstitute.sting.utils.threading.ThreadPoolMonitor;
import java.util.Collection; import java.util.Collection;
@ -101,7 +102,7 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar
while (isShardTraversePending() || isTreeReducePending()) { while (isShardTraversePending() || isTreeReducePending()) {
// Check for errors during execution. // Check for errors during execution.
if(hasTraversalErrorOccurred()) 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. // Too many files sitting around taking up space? Merge them.
if (isMergeLimitExceeded()) if (isMergeLimitExceeded())
@ -344,10 +345,15 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar
return error != null; return error != null;
} }
private synchronized Throwable getTraversalError() { private synchronized StingException getTraversalError() {
if(!hasTraversalErrorOccurred()) if(!hasTraversalErrorOccurred())
throw new ReviewedStingException("User has attempted to retrieve a traversal error when none exists"); 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);
} }
/** /**