mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 05:14:27 +01:00
change errors codes
This commit is contained in:
parent
905ace3e13
commit
d0ef1ef174
@ -103,7 +103,6 @@ impl ErrorCode for MilliError<'_> {
|
|||||||
milli::Error::UserError(ref error) => {
|
milli::Error::UserError(ref error) => {
|
||||||
match error {
|
match error {
|
||||||
// TODO: wait for spec for new error codes.
|
// TODO: wait for spec for new error codes.
|
||||||
UserError::AttributeLimitReached
|
|
||||||
| UserError::Csv(_)
|
| UserError::Csv(_)
|
||||||
| UserError::SerdeJson(_)
|
| UserError::SerdeJson(_)
|
||||||
| UserError::MaxDatabaseSizeReached
|
| UserError::MaxDatabaseSizeReached
|
||||||
@ -112,6 +111,7 @@ impl ErrorCode for MilliError<'_> {
|
|||||||
| UserError::InvalidStoreFile
|
| UserError::InvalidStoreFile
|
||||||
| UserError::NoSpaceLeftOnDevice
|
| UserError::NoSpaceLeftOnDevice
|
||||||
| UserError::DocumentLimitReached => Code::Internal,
|
| UserError::DocumentLimitReached => Code::Internal,
|
||||||
|
UserError::AttributeLimitReached => Code::MaxFieldsLimitExceeded,
|
||||||
UserError::InvalidFilter(_) => Code::Filter,
|
UserError::InvalidFilter(_) => Code::Filter,
|
||||||
UserError::InvalidFilterAttribute(_) => Code::Filter,
|
UserError::InvalidFilterAttribute(_) => Code::Filter,
|
||||||
UserError::MissingDocumentId { .. } => Code::MissingDocumentId,
|
UserError::MissingDocumentId { .. } => Code::MissingDocumentId,
|
||||||
@ -146,10 +146,11 @@ impl ErrorCode for PayloadError {
|
|||||||
fn error_code(&self) -> Code {
|
fn error_code(&self) -> Code {
|
||||||
match self {
|
match self {
|
||||||
PayloadError::Json(err) => match err {
|
PayloadError::Json(err) => match err {
|
||||||
JsonPayloadError::Deserialize(_) => Code::BadRequest,
|
|
||||||
JsonPayloadError::Overflow => Code::PayloadTooLarge,
|
JsonPayloadError::Overflow => Code::PayloadTooLarge,
|
||||||
JsonPayloadError::ContentType => Code::UnsupportedMediaType,
|
JsonPayloadError::ContentType => Code::UnsupportedMediaType,
|
||||||
JsonPayloadError::Payload(_) => Code::BadRequest,
|
JsonPayloadError::Payload(aweb::error::PayloadError::Overflow) => Code::PayloadTooLarge,
|
||||||
|
JsonPayloadError::Deserialize(_)
|
||||||
|
| JsonPayloadError::Payload(_) => Code::BadRequest,
|
||||||
JsonPayloadError::Serialize(_) => Code::Internal,
|
JsonPayloadError::Serialize(_) => Code::Internal,
|
||||||
_ => Code::Internal,
|
_ => Code::Internal,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user