mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
Return an error when calling DELETE /tasks with an empty query
This commit is contained in:
parent
9067148270
commit
dabc30d3d6
4 changed files with 28 additions and 1 deletions
|
@ -149,6 +149,7 @@ pub enum Code {
|
|||
NoSpaceLeftOnDevice,
|
||||
DumpNotFound,
|
||||
TaskNotFound,
|
||||
TaskDeletionWithEmptyQuery,
|
||||
PayloadTooLarge,
|
||||
RetrieveDocument,
|
||||
SearchDocuments,
|
||||
|
@ -236,6 +237,10 @@ impl Code {
|
|||
ErrCode::authentication("missing_authorization_header", StatusCode::UNAUTHORIZED)
|
||||
}
|
||||
TaskNotFound => ErrCode::invalid("task_not_found", StatusCode::NOT_FOUND),
|
||||
// TODO: Lo: find the proper error name & message for this one
|
||||
TaskDeletionWithEmptyQuery => {
|
||||
ErrCode::invalid("task_deletion_with_empty_query", StatusCode::BAD_REQUEST)
|
||||
}
|
||||
DumpNotFound => ErrCode::invalid("dump_not_found", StatusCode::NOT_FOUND),
|
||||
NoSpaceLeftOnDevice => {
|
||||
ErrCode::internal("no_space_left_on_device", StatusCode::INTERNAL_SERVER_ERROR)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue