mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
Merge #240
240: Rework error messages r=irevoire a=MarinPostma Simplify the error messages, and make them more compliant with legacy Meilisearch. Basically, stop composing the messages, and simply forward the message of inner errors. Co-authored-by: marin postma <postma.marin@protonmail.com>
This commit is contained in:
commit
b6ca7929eb
7 changed files with 32 additions and 32 deletions
|
@ -9,11 +9,11 @@ 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}")]
|
||||
#[error("{0}")]
|
||||
Facet(#[from] FacetError),
|
||||
#[error("{0}")]
|
||||
Milli(#[from] milli::Error),
|
||||
|
@ -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