mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 08:41:00 +00: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:
@ -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),
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user