chore: lowercase all error messages and add # Errors doc sections

- Fix err-lowercase-msg: normalize all #[error(...)] display strings to
  lowercase (AppError, FileError, ApiErr) and update affected tests
- Fix err-doc-errors: add # Errors sections to 25+ fallible public
  functions across db.rs, store.rs, embedding.rs, indexes.rs,
  ingestion_task.rs, and ingest_limits.rs
This commit is contained in:
Per Stark
2026-05-27 14:59:48 +02:00
parent 4579725130
commit 224a7db451
9 changed files with 221 additions and 54 deletions
+8
View File
@@ -159,6 +159,10 @@ impl FtsIndexSpec {
/// Build runtime Surreal indexes (FTS + HNSW) using concurrent creation with readiness polling.
/// Idempotent: safe to call multiple times and will overwrite HNSW definitions when the dimension changes.
///
/// # Errors
///
/// Returns `AppError::InternalError` if any index definition or polling step fails.
pub async fn ensure_runtime(
db: &SurrealDbClient,
embedding_dimension: usize,
@@ -169,6 +173,10 @@ pub async fn ensure_runtime(
}
/// Rebuild known FTS and HNSW indexes, skipping any that are not yet defined.
///
/// # Errors
///
/// Returns `AppError::InternalError` if any index rebuild operation fails.
pub async fn rebuild(db: &SurrealDbClient) -> Result<(), AppError> {
rebuild_inner(db)
.await