Skip to content

Commit

Permalink
more descriptive error for index loading failure on stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremiah Wala committed Oct 11, 2016
1 parent 0c34562 commit 2336b3e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/BamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ bool _Bam::SetRegion(const GenomicRegion& gp) {
idx = SharedIndex(sam_index_load(fp.get(), m_in.c_str()), idx_delete());

if (!idx) {
std::cerr << "Failed to load index for " << m_in << ". Rebuild samtools index" << std::endl;
if (m_in != "-")
std::cerr << "Failed to load index for " << m_in << ". Rebuild samtools index" << std::endl;
else
std::cerr << "Random access with SetRegion not available for STDIN reading (no index file)" << std::endl;
return false;
}

Expand Down

0 comments on commit 2336b3e

Please sign in to comment.