Tribble exceptions can be generated outside of the normal codec parsing code because we now lazy load the VCF genotype fields. I'm not sure how else to account for this (to make sure they show up as user errors and not GATK system errors) besides catching them here.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4554 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
e24f7fec47
commit
72c5b75460
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue