Make error messages clearer (even I was confused)
This commit is contained in:
parent
6cadaa84c9
commit
48c4a8cb33
|
|
@ -1357,10 +1357,10 @@ public class VariantContext implements Feature { // to enable tribble intergrati
|
||||||
throw new IllegalArgumentException("Duplicate allele added to VariantContext: " + a);
|
throw new IllegalArgumentException("Duplicate allele added to VariantContext: " + a);
|
||||||
}
|
}
|
||||||
|
|
||||||
// deal with the case where the first allele isn't the reference
|
// deal with the case where the first allele isn't the reference
|
||||||
if ( a.isReference() ) {
|
if ( a.isReference() ) {
|
||||||
if ( sawRef )
|
if ( sawRef )
|
||||||
throw new IllegalArgumentException("Alleles for a VariantContext must contain a single reference allele: " + alleles);
|
throw new IllegalArgumentException("Alleles for a VariantContext must contain at most one reference allele: " + alleles);
|
||||||
alleleList.add(0, a);
|
alleleList.add(0, a);
|
||||||
sawRef = true;
|
sawRef = true;
|
||||||
}
|
}
|
||||||
|
|
@ -1372,7 +1372,7 @@ public class VariantContext implements Feature { // to enable tribble intergrati
|
||||||
throw new IllegalArgumentException("Cannot create a VariantContext with an empty allele list");
|
throw new IllegalArgumentException("Cannot create a VariantContext with an empty allele list");
|
||||||
|
|
||||||
if ( alleleList.get(0).isNonReference() )
|
if ( alleleList.get(0).isNonReference() )
|
||||||
throw new IllegalArgumentException("Alleles for a VariantContext must contain a single reference allele: " + alleles);
|
throw new IllegalArgumentException("Alleles for a VariantContext must contain at least one reference allele: " + alleles);
|
||||||
|
|
||||||
return alleleList;
|
return alleleList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue