mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
review changes
This commit is contained in:
parent
763ee521be
commit
56686dee40
10 changed files with 24 additions and 23 deletions
|
@ -3,7 +3,7 @@ use std::io::{BufRead, BufReader, Write};
|
|||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
|
||||
use anyhow::Context;
|
||||
use anyhow::{Context, bail};
|
||||
use heed::RoTxn;
|
||||
use indexmap::IndexMap;
|
||||
use milli::update::{IndexDocumentsMethod, UpdateFormat::JsonStream};
|
||||
|
@ -126,7 +126,7 @@ impl Index {
|
|||
|
||||
match Arc::try_unwrap(index.0) {
|
||||
Ok(inner) => inner.prepare_for_closing().wait(),
|
||||
Err(_) => todo!("Could not close index properly."),
|
||||
Err(_) => bail!("Could not close index properly."),
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -9,9 +9,9 @@ pub type Result<T> = std::result::Result<T, IndexError>;
|
|||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum IndexError {
|
||||
#[error("Internal error: {0}")]
|
||||
#[error("internal error: {0}")]
|
||||
Internal(Box<dyn Error + Send + Sync + 'static>),
|
||||
#[error("Document with id {0} not found.")]
|
||||
#[error("document with id {0} not found.")]
|
||||
DocumentNotFound(String),
|
||||
#[error("error with facet: {0}")]
|
||||
Facet(#[from] FacetError),
|
||||
|
@ -39,7 +39,7 @@ impl ErrorCode for IndexError {
|
|||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum FacetError {
|
||||
#[error("Invalid facet expression, expected {}, found: {1}", .0.join(", "))]
|
||||
#[error("invalid facet expression, expected {}, found: {1}", .0.join(", "))]
|
||||
InvalidExpression(&'static [&'static str], Value),
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue