THROWIF¶
The THROWIF command is a very simple tool which throws an exception if the contained statement is true.
By default the error message is Gor throw on: <condition>. Use -m to give a custom message. The error also
includes the header and the row that triggered the exception.
Usage¶
gor ... | THROWIF [<options>] <condition>
Options¶
|
If set an retriable exception is thrown. |
|
Use |
Examples¶
Fail with a custom message:
gorrow chr1,1 | calc status 'unmapped' | THROWIF -m 'liftover failed' status != 'mapped'
The error report contains (command source and stack trace omitted):
==== Data Error ====
liftover failed
Header: chrom pos status
Row: chr1 1 unmapped