Malformed VCF headers should be User Errors

This commit is contained in:
Eric Banks 2012-05-31 16:05:53 -04:00
parent d1822c926c
commit 3a15ba2102
1 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,7 @@
package org.broadinstitute.sting.utils.codecs.vcf;
import org.broadinstitute.sting.utils.exceptions.UserException;
import java.util.*;
/**
@ -75,10 +77,10 @@ class VCF4Parser implements VCFLineParser {
index = 0;
if ( expectedTagOrder != null ) {
if ( ret.size() > expectedTagOrder.size() )
throw new IllegalArgumentException("Unexpected tag count " + ret.size() + " in string " + expectedTagOrder.size());
throw new UserException.MalformedVCFHeader("unexpected tag count " + ret.size() + " in line " + valueLine);
for ( String str : ret.keySet() ) {
if ( !expectedTagOrder.get(index).equals(str) )
throw new IllegalArgumentException("Unexpected tag " + str + " in string " + valueLine);
throw new UserException.MalformedVCFHeader("Unexpected tag " + str + " in line " + valueLine);
index++;
}
}