mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
missing payload error
This commit is contained in:
parent
18cb514073
commit
4eb3817b03
6 changed files with 49 additions and 17 deletions
|
@ -5,7 +5,7 @@ use meilisearch_error::{Code, ErrorCode};
|
|||
|
||||
use crate::{
|
||||
document_formats::DocumentFormatError,
|
||||
index_controller::update_file_store::UpdateFileStoreError,
|
||||
index_controller::{update_file_store::UpdateFileStoreError, DocumentAdditionFormat},
|
||||
};
|
||||
|
||||
pub type Result<T> = std::result::Result<T, UpdateLoopError>;
|
||||
|
@ -26,6 +26,8 @@ pub enum UpdateLoopError {
|
|||
// TODO: The reference to actix has to go.
|
||||
#[error("{0}")]
|
||||
PayloadError(#[from] actix_web::error::PayloadError),
|
||||
#[error("A {0} payload is missing.")]
|
||||
MissingPayload(DocumentAdditionFormat),
|
||||
}
|
||||
|
||||
impl<T> From<tokio::sync::mpsc::error::SendError<T>> for UpdateLoopError
|
||||
|
@ -63,6 +65,7 @@ impl ErrorCode for UpdateLoopError {
|
|||
actix_web::error::PayloadError::Overflow => Code::PayloadTooLarge,
|
||||
_ => Code::Internal,
|
||||
},
|
||||
Self::MissingPayload(_) => Code::MissingPayload,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue