Skip to content

tabix should return a non-zero exit code on invalid index column #1885

@Fan-iX

Description

@Fan-iX

When making index, tabix only prints error message when it encounters a row with invalid (non numeric) value in index (-b/-s) column but still exit with code 0 (usually indicating a success). While it do exit with a non-zero code when querying data.

$ printf 'A\t1\t2\nA\ta\t3\nA\t3\t4\n' | bgzip > test.gz

$ tabix -p bed test.gz
[E::get_intv] Failed to parse TBX_GENERIC: was wrong -p [type] used?
The offending line was: "A      a       3"

$ echo $?
0

$ echo A | tabix -R - test.gz
A       1       2
[E::get_intv] Failed to parse TBX_GENERIC: was wrong -p [type] used?
The offending line was: "A      a       3"
Reading "test.gz" failed: No such file or directory

$ echo $?
1

It would be nice if it could exit with a non-zero code indicating the error. This will make it easier to interrupt a workflow if users provided a malformed file.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions