decompose error messages

This commit is contained in:
marin postma 2021-06-24 10:53:51 +02:00
parent a2368db154
commit a1d34faaad
No known key found for this signature in database
GPG key ID: 6088B7721C3E39F9
7 changed files with 32 additions and 32 deletions

View file

@ -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),
}