fix the sort error messages

This commit is contained in:
Tamo 2021-09-28 14:49:13 +02:00
parent 654f49ccec
commit 539a57026d
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
3 changed files with 9 additions and 17 deletions

View file

@ -83,7 +83,6 @@ impl ErrorCode for MilliError<'_> {
UserError::AttributeLimitReached => Code::MaxFieldsLimitExceeded,
UserError::InvalidFilter(_) => Code::Filter,
UserError::InvalidFilterAttribute(_) => Code::Filter,
UserError::InvalidSortName { .. } => Code::Sort,
UserError::MissingDocumentId { .. } => Code::MissingDocumentId,
UserError::MissingPrimaryKey => Code::MissingPrimaryKey,
UserError::PrimaryKeyCannotBeChanged => Code::PrimaryKeyAlreadyPresent,
@ -92,9 +91,9 @@ impl ErrorCode for MilliError<'_> {
UserError::UnknownInternalDocumentId { .. } => Code::DocumentNotFound,
UserError::InvalidFacetsDistribution { .. } => Code::BadRequest,
UserError::InvalidGeoField { .. } => Code::InvalidGeoField,
UserError::InvalidSortableAttribute { .. }
| UserError::InvalidReservedSortName { .. } => Code::Sort,
UserError::CriterionError(_) => Code::BadRequest,
UserError::InvalidSortableAttribute { .. } => Code::Sort,
UserError::SortError(_) => Code::Sort,
UserError::CriterionError(_) => Code::InvalidRankingRule,
}
}
}