Closed lbeltrame closed 3 years ago
I see what you mean about sending no arguments. I have a local fix for that. but I can not recreate when there's a problem with the config. Using files in the vcfanno repo and this conf (diff.toml):
[[annotation]]
file="tmp_annotation.txt.gz"
columns = [9, 10, 11]
names=["REF_60", "HET_60", "XXX"]
ops=["first", "first"]
I run:
vcfanno -base-path tests/ref-alt-test/ ./diff.toml tests/ref-alt-test/tmp_calls.vcf.gz > x.vcf
and see:
=============================================
vcfanno version 0.3.3 [built with go1.16.5]
see: https://github.com/brentp/vcfanno
=============================================
vcfanno.go:92: CheckAnno err:must specify same # of 'columns' as 'ops' for tmp_annotation.txt.gz
$ echo $?
1
so it has exit code 1. Can you show how to recreate the problem with a bad conf?
Hmm, it looks like you're right. If that's the case, the problem I thought it was in vcfanno is somewhere else. I'll leave the issue open for the usage/help scenario which is a real bug.
EDIT: I think I found the actual source of the problem and it was outside vcfanno (error code was correct, but it was gobbled up during the processing), so this can be closed.
I had a malformed configuration file, which included more
ops
thannames
in its contents (provided below). As expected, vcfanno failed. The problem is that while it failed, it exited with error code 0, which is interpreted as success pipelines, workflows, etc.As it was part of a workflow, it proceeded to the next step as the failure was interpreted as success.
This isn't specific to a bad configuration, or a user error. Any command, success or not, returns error code 0:
For a comparison, common programs like those in GNU return all but 0 in case of anything that's not success.
Observed result: Exit code of 0 regardless of the final state of the program (error, success)
Expected result: Exit code != 0 in case of errors.