Skip to content

Commit

Permalink
Make faidx error messages slightly more enlightening
Browse files Browse the repository at this point in the history
  • Loading branch information
nickzoic authored and jkbonfield committed Feb 15, 2024
1 parent dd9c561 commit 4ff46a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions faidx.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static faidx_t *fai_build_core(BGZF *bgzf) {
kputsn("", 0, &name);

if (c < 0) {
hts_log_error("The last entry '%s' has no sequence", name.s);
hts_log_error("The last entry '%s' has no sequence at line %d", name.s, line_num);
goto fail;
}

Expand Down Expand Up @@ -247,7 +247,7 @@ static faidx_t *fai_build_core(BGZF *bgzf) {
state = SEQ_END;

} else if (line_len < ll) {
hts_log_error("Different line length in sequence '%s'", name.s);
hts_log_error("Different line length in sequence '%s' at line %d", name.s, line_num);
goto fail;
}

Expand All @@ -269,7 +269,7 @@ static faidx_t *fai_build_core(BGZF *bgzf) {
case IN_QUAL:
if (c == '\n') {
if (!read_done) {
hts_log_error("Inlined empty line is not allowed in quality of sequence '%s'", name.s);
hts_log_error("Inlined empty line is not allowed in quality of sequence '%s' at line %d", name.s, line_num);
goto fail;
}

Expand Down Expand Up @@ -312,6 +312,7 @@ static faidx_t *fai_build_core(BGZF *bgzf) {
if (fai_insert_index(idx, name.s, seq_len, line_len, char_len, seq_offset, qual_offset) != 0)
goto fail;
} else {
hts_log_error("File truncated at line %d", line_num);
goto fail;
}

Expand Down

0 comments on commit 4ff46a6

Please sign in to comment.