Permalink
Browse files

Throw on unrecognized CRAM encoding tag. (#593)

  • Loading branch information...
1 parent b81d036 commit 0d0da8774eb86b1ec594cb485e2d300a9b362f4a @cmnbroad cmnbroad committed with lbergelson Aug 23, 2016
@@ -56,9 +56,7 @@ public AbstractReader buildReader(final AbstractReader reader,
final DataSeries dataSeries = field.getAnnotation(DataSeries.class);
final EncodingKey key = dataSeries.key();
final DataSeriesType type = dataSeries.type();
- if (header.encodingMap.get(key) == null) {
- log.debug("Encoding not found for key: " + key);
- } else {
+ if (header.encodingMap.get(key) != null) {
try {
field.set(reader,
createReader(type, header.encodingMap.get(key), bitInputStream, inputMap));
@@ -17,6 +17,7 @@
*/
package htsjdk.samtools.cram.structure;
+import htsjdk.samtools.cram.CRAMException;
import htsjdk.samtools.cram.encoding.ExternalCompressor;
import htsjdk.samtools.cram.encoding.NullEncoding;
import htsjdk.samtools.cram.io.ITF8;
@@ -170,8 +171,7 @@ else if (TD_tagIdsDictionary.equals(key)) {
final String key = new String(new byte[]{buffer.get(), buffer.get()});
final EncodingKey encodingKey = EncodingKey.byFirstTwoChars(key);
if (encodingKey == null) {
- log.debug("Unknown encoding key: " + key);
- continue;
+ throw new CRAMException("Unknown encoding key: " + key);
}
final EncodingID id = EncodingID.values()[buffer.get()];

0 comments on commit 0d0da87

Please sign in to comment.