Skip to content

fix(worklog): propagate rg errors in search.sh instead of silently swallowing - #30

Merged
cheshirecode merged 1 commit into
mainfrom
codex/worklog-search-error-handling
Aug 11, 2026
Merged

fix(worklog): propagate rg errors in search.sh instead of silently swallowing#30
cheshirecode merged 1 commit into
mainfrom
codex/worklog-search-error-handling

Conversation

@cheshirecode

Copy link
Copy Markdown
Owner

Summary

search.sh used 2>/dev/null || true on the rg/xargs pipeline at line 206-207, making rg errors (invalid regex, file I/O failures, binary match problems) indistinguishable from genuine 'no hits' results. If rg failed, the caller got (no hits for /pattern/) — a misleading dead end.

Fix: capture rg stderr to a temp file and print it to stderr if non-empty. Genuine 'no hits' still shows (no hits for ...) and exits 1, but real errors are now surfaced.

Validation

  • bash tests/run.sh all: 75 pass, 0 fail
  • Includes existing search fallback tests (grep when rg unavailable, rg arg rejection)

Worklog-Slug: worklog-search-error-handling

…allowing

The rg/xargs pipeline used 2>/dev/null || true, making rg errors (invalid regex, binary match failures) indistinguishable from genuine 'no hits' results. Capture stderr to a temp file and print it if non-empty.
@cheshirecode
cheshirecode merged commit 17ed050 into main Aug 11, 2026
8 checks passed
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.

1 participant