diff --git a/java/src/org/broadinstitute/sting/commandline/CommandLineProgram.java b/java/src/org/broadinstitute/sting/commandline/CommandLineProgram.java index 74bb7bc8d..a4af97520 100644 --- a/java/src/org/broadinstitute/sting/commandline/CommandLineProgram.java +++ b/java/src/org/broadinstitute/sting/commandline/CommandLineProgram.java @@ -28,7 +28,6 @@ package org.broadinstitute.sting.commandline; import org.apache.log4j.*; import org.broadinstitute.sting.gatk.CommandLineGATK; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; -import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.help.ApplicationDetails; import org.broadinstitute.sting.utils.help.HelpFormatter; @@ -381,7 +380,7 @@ public abstract class CommandLineProgram { System.exit(1); } - public static void exitSystemWithUserError(UserException e) { + public static void exitSystemWithUserError(final Exception e) { if ( e.getMessage() == null ) throw new ReviewedStingException("UserException found with no message!", e); diff --git a/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java b/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java index 3e3f974a9..b3440160a 100755 --- a/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java +++ b/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java @@ -25,6 +25,7 @@ package org.broadinstitute.sting.gatk; +import org.broad.tribble.TribbleException; import org.broadinstitute.sting.gatk.arguments.GATKArgumentCollection; import org.broadinstitute.sting.gatk.walkers.Attribution; import org.broadinstitute.sting.utils.exceptions.UserException; @@ -87,6 +88,10 @@ public class CommandLineGATK extends CommandLineExecutable { System.exit(CommandLineProgram.result); // todo -- this is a painful hack } catch (UserException e) { exitSystemWithUserError(e); + } catch (TribbleException e) { + // We can generate Tribble Exceptions in weird places when e.g. VCF genotype fields are + // lazy loaded, so they aren't caught elsewhere and made into User Exceptions + exitSystemWithUserError(e); } catch (Exception e) { exitSystemWithError(e); }