From 72c5b75460c09c426a037c2770f81f71ef7778cc Mon Sep 17 00:00:00 2001 From: ebanks Date: Fri, 22 Oct 2010 15:22:17 +0000 Subject: [PATCH] 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 --- .../broadinstitute/sting/commandline/CommandLineProgram.java | 3 +-- java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) 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); }