samtools / htsjdk

A Java API for high-throughput sequencing data (HTS) formats.
http://samtools.github.io/htsjdk/
283 stars 242 forks source link

Add context to exception when the .vcf file is invalid #1566

Closed yash-puligundla closed 3 years ago

yash-puligundla commented 3 years ago

Description

When an invalid header line is present in a VCF file, htsjdk errors without specific details. More details here

Fix

Adding the line number of the VCF file's invalid line to the error message.

codecov-commenter commented 3 years ago

Codecov Report

Merging #1566 (05e01c6) into master (c647764) will decrease coverage by 0.003%. The diff coverage is 0.000%.

@@               Coverage Diff               @@
##              master     #1566       +/-   ##
===============================================
- Coverage     69.841%   69.839%   -0.003%     
- Complexity      9633      9637        +4     
===============================================
  Files            702       702               
  Lines          37611     37611               
  Branches        6108      6107        -1     
===============================================
- Hits           26268     26267        -1     
  Misses          8897      8897               
- Partials        2446      2447        +1     
Impacted Files Coverage Δ
...java/htsjdk/variant/vcf/VCFCompoundHeaderLine.java 74.830% <0.000%> (ø)
src/main/java/htsjdk/io/AsyncWriterPool.java 72.222% <0.000%> (-1.389%) :arrow_down:
cmnbroad commented 3 years ago

Fixes https://github.com/samtools/htsjdk/issues/1565. @lbergelson Can you merge this one (I don't seem to be able to merge at all anymore).