Skip to content

πŸ”§ [P3] Error handling improvements β€” stop leaking internalsΒ #144

Closed

Description

@ajianaz

Problem

Multiple error handling issues:

  1. Internal error details leaked β€” usearch, ONNX runtime, rusqlite internals visible in user-facing errors
  2. rusqlite error context lost β€” map_err(|e| Error::Database(e.to_string())) loses original error type
  3. row_to_memory silently swallows parse errors β€” corrupted JSON in tags/metadata treated as empty, no warning
  4. Mutex poison errors generic β€” all lock failures become "Failed to acquire index lock" with no panic context

Proposed Fixes

  1. Create user-friendly error messages for common failures
  2. Wrap rusqlite errors preserving source
  3. Log warnings for corrupted data instead of silent defaults
  4. Add error context (operation name, input summary) to all error variants

Effort: ~0.5 day

Activity

  1. added this to the Backlog milestone on Jun 2, 2026
  2. ajianaz commented on Jun 7, 2026

    @ajianaz
    CollaboratorAuthor

    Error handling is already solid β€” structured errors via thiserror with sanitization for DB/embedding internals, comprehensive test coverage in error.rs. No further work needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope:core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions