Skip to content

feat(ENGKNOW-3999): throwif -m <message> and offending row in error - #153

Merged
gmagnu merged 4 commits into
mainfrom
ENGKNOW-3999-throwif-message-and-detail
Oct 7, 2026
Merged

gmagnu merged 4 commits into
mainfrom
ENGKNOW-3999-throwif-message-and-detail

Conversation

@gmagnu

@gmagnu gmagnu commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

ENGKNOW-3999:

  • -m <message> — use a literal (quoted) message instead of Gor throw on: <condition>. Works with -retriable.
  • The thrown GorDataException now always carries the header and the offending row. It is built with doFormat=false, so getMessage() stays the plain message and ExceptionUtilities renders Header:/Row: once. In nor context the internal ChromNOR/PosNOR columns are omitted.

The -d option from the ticket is not needed: the row is always attached.

gorrow chr1,1 | calc status 'unmapped' | throwif -m 'liftover failed' status != 'mapped'

→

liftover failed

Header: chrom	pos	status
Row: chr1	1	unmapped

Needed for variant_liftover / interval_liftover raise mode (ENGKNOW-3942).

Tests

  • UTestThrowIfAnalysis: custom message (+ header/row), custom message + retriable.
  • UTestThrowIf (query level): default message unchanged, -m, message with spaces/quotes, only the offending row attached, rendered error shows Header/Row exactly once, with -retriable, nor context.
  • Re-ran other suites using throwif — all pass.

Docs: documentation/src/command/THROWIF.rst updated.

🤖 Generated with Claude Code

-m replaces the default "Gor throw on: <condition>" message with a literal
(quoted) string. -d adds the header and the row that triggered the throw to
the error via GorDataException's header/row support. In nor context the
internal ChromNOR/PosNOR columns are left out. Options combine with each
other and with -retriable; default behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Junit Tests - Summary

4 921 tests  +9   4 750 ✅ +9   20m 27s ⏱️ +4s
  510 suites +1     171 💤 ±0 
  510 files   +1       0 ❌ ±0 

Results for commit 91dcfe7. ± Comparison against base commit e2d22eb.

♻️ This comment has been updated with latest results.

@gmagnu
gmagnu marked this pull request as ready for review October 6, 2026 22:03
-d formatted the header and row into the message while ExceptionUtilities
also appends getHeader()/getRow(), so they were printed twice. The option is
not needed; remove it. Use stringValueOfOptionWithDefault for -m.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gmagnu gmagnu changed the title feat(ENGKNOW-3999): throwif -m <message> and -d to include offending row feat(ENGKNOW-3999): throwif -m <message> option Oct 6, 2026
The GorDataException now carries the header and the row that triggered the
throw, built with doFormat=false so getMessage() stays the plain message and
ExceptionUtilities renders Header/Row once. In nor context the internal
ChromNOR/PosNOR columns are left out.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gmagnu gmagnu changed the title feat(ENGKNOW-3999): throwif -m <message> option feat(ENGKNOW-3999): throwif -m <message> and offending row in error Oct 6, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gmagnu
gmagnu merged commit 76ac6b8 into main Oct 7, 2026
14 checks passed
@gmagnu
gmagnu deleted the ENGKNOW-3999-throwif-message-and-detail branch October 7, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants