diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageStats.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageStats.java index 5ad213903..5345f9f48 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageStats.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageStats.java @@ -1,6 +1,7 @@ package org.broadinstitute.sting.gatk.walkers.coverage; import org.broadinstitute.sting.utils.BaseUtils; +import org.broadinstitute.sting.utils.exceptions.UserException; import java.util.HashMap; import java.util.Map; @@ -45,8 +46,7 @@ public class DepthOfCoverageStats { public static int[] calculateBinEndpoints(int lower, int upper, int bins) { if ( bins > upper - lower || lower < 1 ) { - throw new IllegalArgumentException("Illegal argument to calculateBinEndpoints; "+ - "lower bound must be at least 1, and number of bins may not exceed stop - start"); + throw new UserException.BadInput("the start must be at least 1 and the number of bins may not exceed stop - start"); } int[] binLeftEndpoints = new int[bins+1]; diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/refseq/RefSeqCodec.java b/public/java/src/org/broadinstitute/sting/utils/codecs/refseq/RefSeqCodec.java index efcd3ecf0..cb392f29c 100644 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/refseq/RefSeqCodec.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/refseq/RefSeqCodec.java @@ -73,6 +73,8 @@ public class RefSeqCodec implements ReferenceDependentFeatureCodec alleles) { if ( index.equals(VCFConstants.EMPTY_ALLELE) ) return Allele.NO_CALL; - int i = Integer.valueOf(index); + final int i; + try { + i = Integer.valueOf(index); + } catch ( NumberFormatException e ) { + throw new TribbleException.InternalCodecException("The following invalid GT allele index was encountered in the file: " + index); + } if ( i >= alleles.size() ) throw new TribbleException.InternalCodecException("The allele with index " + index + " is not defined in the REF/ALT columns in the record"); return alleles.get(i);