Skip to content

fix: print repository error prefix once; reject blank hsearch queries - #81

Merged
sysid merged 2 commits into
mainfrom
fix/error-prefix-blank-query
Oct 4, 2026
Merged

sysid merged 2 commits into
mainfrom
fix/error-prefix-blank-query

Conversation

@sysid

@sysid sysid commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #80, which was merged before these two commits were pushed.

Commit Problem Fix
fix(errors): print the repository error prefix once Errors read Repository error: Repository error: … — RepositoryError::Other repeated the prefix its DomainError wrapper already adds Other displays the bare message, like all other Other variants
fix(hsearch): reject blank queries with a validation error Empty/whitespace query reached FTS5: fts5: syntax error near "" Validation error before any search runs, pointing to search for tag-only browsing

Before / after:

$ bkmr search 'foo-bar'
main:  Error: ... Repository error: Repository error: performing FTS search for query: foo-bar: Database error: no such column: bar
PR:    Error: ... Repository error: performing FTS search for query: foo-bar: Database error: no such column: bar

$ bkmr hsearch '  '
main:  Error: ... Query error: fts5: syntax error near ""
PR:    Error: ... Validation failed: ... hybrid search query must not be empty (use `search` to browse by tags)

Testing

Tests written first and verified failing on main:

  • Error display contains Repository error: exactly once (context-wrapped Query and plain Other)
  • Blank and whitespace-only hsearch queries return ApplicationError::Validation

make test green.

sysid added 2 commits October 4, 2026 15:14
DomainError::RepositoryError already prefixes its message with
"Repository error:". RepositoryError::Other added the same prefix, and
every context() call and OperationFailed conversion ends up in Other,
so users saw "Repository error: Repository error: ...".

Display Other as the bare message, like the Other variants of all the
other error enums.
An empty or whitespace-only query reached FTS5 and failed with
"fts5: syntax error near """. Reject it before any search runs, and
point to search for tag-only browsing.
@sysid
sysid merged commit 36a833a into main Oct 4, 2026
2 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