For BAM and Reviewed errors we now check the error message to see if it's actually a 'too many open files' problem and, if so, we generate a User Error instead.
This commit is contained in:
parent
5e7b9ae119
commit
5821c11fad
|
|
@ -392,7 +392,7 @@ public abstract class CommandLineProgram {
|
|||
/**
|
||||
* used to indicate an error occured
|
||||
*
|
||||
* @param e the exception occured
|
||||
* @param t the exception that occurred
|
||||
*/
|
||||
public static void exitSystemWithError(Throwable t) {
|
||||
exitSystemWithError(t.getMessage(), t);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import org.broadinstitute.sting.commandline.Argument;
|
|||
import org.broadinstitute.sting.commandline.ArgumentCollection;
|
||||
import org.broadinstitute.sting.commandline.CommandLineProgram;
|
||||
import org.broadinstitute.sting.gatk.arguments.GATKArgumentCollection;
|
||||
import org.broadinstitute.sting.gatk.filters.ReadFilter;
|
||||
import org.broadinstitute.sting.gatk.refdata.tracks.FeatureManager;
|
||||
import org.broadinstitute.sting.gatk.walkers.Attribution;
|
||||
import org.broadinstitute.sting.gatk.walkers.Walker;
|
||||
|
|
@ -97,13 +96,20 @@ public class CommandLineGATK extends CommandLineExecutable {
|
|||
// lazy loaded, so they aren't caught elsewhere and made into User Exceptions
|
||||
exitSystemWithUserError(e);
|
||||
} catch (net.sf.samtools.SAMException e) {
|
||||
// Let's try this out and see how it is received by our users
|
||||
checkForTooManyOpenFilesProblem(e.getMessage());
|
||||
exitSystemWithSamError(e);
|
||||
} catch (Throwable t) {
|
||||
checkForTooManyOpenFilesProblem(t.getMessage());
|
||||
exitSystemWithError(t);
|
||||
}
|
||||
}
|
||||
|
||||
private static void checkForTooManyOpenFilesProblem(String message) {
|
||||
// Special case the "Too many open files" error because it's a common User Error for which we know what to do
|
||||
if ( message.indexOf("Too many open files") != -1 )
|
||||
exitSystemWithUserError(new UserException.TooManyOpenFiles());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the a short blurb about the GATK, copyright info, and where to get documentation.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -100,6 +100,12 @@ public class UserException extends ReviewedStingException {
|
|||
}
|
||||
}
|
||||
|
||||
public static class TooManyOpenFiles extends UserException {
|
||||
public TooManyOpenFiles() {
|
||||
super(String.format("There was a failure because there are too many files open concurrently; your system's open file handle limit is too small. See the unix ulimit command to adjust this limit"));
|
||||
}
|
||||
}
|
||||
|
||||
public static class ErrorWritingBamFile extends UserException {
|
||||
public ErrorWritingBamFile(String message) {
|
||||
super(String.format("An error occurred when trying to write the BAM file. Usually this happens when there is not enough space in the directory to which the data is being written (generally the temp directory) or when your system's open file handle limit is too small. To tell Java to use a bigger/better file system use -Djava.io.tmpdir=X on the command line. The exact error was %s", message));
|
||||
|
|
|
|||
Loading…
Reference in New Issue