mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-19 03:06:26 +00:00
Return an error when calling DELETE /tasks with an empty query
This commit is contained in:
committed by
Clément Renault
parent
fbd2be2ec8
commit
f32b973945
@ -15,7 +15,9 @@ pub enum Error {
|
||||
CorruptedTaskQueue,
|
||||
#[error("Task `{0}` not found")]
|
||||
TaskNotFound(TaskId),
|
||||
|
||||
// TODO: Lo: proper error message for this
|
||||
#[error("Cannot delete all tasks")]
|
||||
TaskDeletionWithEmptyQuery,
|
||||
// maybe the two next errors are going to move to the frontend
|
||||
#[error("`{0}` is not a status. Available status are")]
|
||||
InvalidStatus(String),
|
||||
@ -41,6 +43,7 @@ impl ErrorCode for Error {
|
||||
Error::IndexNotFound(_) => Code::IndexNotFound,
|
||||
Error::IndexAlreadyExists(_) => Code::IndexAlreadyExists,
|
||||
Error::TaskNotFound(_) => Code::TaskNotFound,
|
||||
Error::TaskDeletionWithEmptyQuery => Code::TaskDeletionWithEmptyQuery,
|
||||
Error::InvalidStatus(_) => Code::BadRequest,
|
||||
Error::InvalidKind(_) => Code::BadRequest,
|
||||
|
||||
|
Reference in New Issue
Block a user