File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,9 @@ std::vector<std::string> TileDBVCFDataset::get_vcf_attributes(std::string uri) {
165
165
166
166
// Read VCF header into string for parsing
167
167
bcf_hdr_t * hdr = VCFUtils::hdr_read_header (uri);
168
+ if (hdr == nullptr ) {
169
+ throw std::runtime_error (" Error reading VCF header from: " + uri);
170
+ }
168
171
std::string hdrstr = VCFUtils::hdr_to_string (hdr);
169
172
const char * p = hdrstr.c_str ();
170
173
Original file line number Diff line number Diff line change @@ -62,6 +62,12 @@ uint32_t VCFUtils::get_end_pos(
62
62
63
63
bcf_hdr_t * VCFUtils::hdr_read_header (const std::string& path) {
64
64
auto fh = vcf_open (path.c_str (), " r" );
65
+
66
+ int retries = 3 ;
67
+ while (!fh && retries--) {
68
+ fh = vcf_open (path.c_str (), " r" );
69
+ }
70
+
65
71
if (!fh)
66
72
return nullptr ;
67
73
auto hdr = bcf_hdr_read (fh);
You can’t perform that action at this time.
0 commit comments