mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
malformed payload error
This commit is contained in:
parent
137272b8de
commit
ddd40d87a7
3 changed files with 14 additions and 5 deletions
|
@ -22,9 +22,7 @@ pub enum UpdateLoopError {
|
|||
)]
|
||||
FatalUpdateStoreError,
|
||||
#[error("{0}")]
|
||||
InvalidPayload(#[from] DocumentFormatError),
|
||||
#[error("{0}")]
|
||||
MalformedPayload(Box<dyn Error + Send + Sync + 'static>),
|
||||
DocumentFormatError(#[from] DocumentFormatError),
|
||||
// TODO: The reference to actix has to go.
|
||||
#[error("{0}")]
|
||||
PayloadError(#[from] actix_web::error::PayloadError),
|
||||
|
@ -60,8 +58,7 @@ impl ErrorCode for UpdateLoopError {
|
|||
Self::Internal(_) => Code::Internal,
|
||||
//Self::IndexActor(e) => e.error_code(),
|
||||
Self::FatalUpdateStoreError => Code::Internal,
|
||||
Self::InvalidPayload(_) => Code::BadRequest,
|
||||
Self::MalformedPayload(_) => Code::BadRequest,
|
||||
Self::DocumentFormatError(error) => error.error_code(),
|
||||
Self::PayloadError(error) => match error {
|
||||
actix_web::error::PayloadError::Overflow => Code::PayloadTooLarge,
|
||||
_ => Code::Internal,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue