Catch exception for bad type and throw as a TribbleException
This commit is contained in:
parent
96b62daff3
commit
2799a1b686
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
package org.broadinstitute.sting.utils.codecs.vcf;
|
package org.broadinstitute.sting.utils.codecs.vcf;
|
||||||
|
|
||||||
|
import org.broad.tribble.TribbleException;
|
||||||
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
|
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -149,7 +150,11 @@ public abstract class VCFCompoundHeaderLine extends VCFHeaderLine implements VCF
|
||||||
count = Integer.valueOf(numberStr);
|
count = Integer.valueOf(numberStr);
|
||||||
|
|
||||||
}
|
}
|
||||||
type = VCFHeaderLineType.valueOf(mapping.get("Type"));
|
try {
|
||||||
|
type = VCFHeaderLineType.valueOf(mapping.get("Type"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new TribbleException(mapping.get("Type") + " is not a valid type in the VCF specification (note that types are case-sensitive)");
|
||||||
|
}
|
||||||
if (type == VCFHeaderLineType.Flag && !allowFlagValues())
|
if (type == VCFHeaderLineType.Flag && !allowFlagValues())
|
||||||
throw new IllegalArgumentException("Flag is an unsupported type for this kind of field");
|
throw new IllegalArgumentException("Flag is an unsupported type for this kind of field");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue