refactor uuid resolver

This commit is contained in:
mpostma 2021-09-22 10:49:59 +02:00
parent 60518449fc
commit def737edee
13 changed files with 223 additions and 246 deletions

View file

@ -1,3 +1,5 @@
use std::error::Error;
use meilisearch_error::Code;
use meilisearch_error::ErrorCode;
@ -24,6 +26,8 @@ pub enum IndexControllerError {
DumpActor(#[from] DumpActorError),
#[error("{0}")]
IndexError(#[from] IndexError),
#[error("Internal error: {0}")]
Internal(Box<dyn Error + Send + Sync + 'static>),
}
impl ErrorCode for IndexControllerError {
@ -35,6 +39,7 @@ impl ErrorCode for IndexControllerError {
IndexControllerError::UpdateActor(e) => e.error_code(),
IndexControllerError::DumpActor(e) => e.error_code(),
IndexControllerError::IndexError(e) => e.error_code(),
IndexControllerError::Internal(_) => Code::Internal,
}
}
}