WIP Introduce the invalid_task_uid error code

This commit is contained in:
Clément Renault
2022-11-03 12:20:54 +01:00
committed by Loïc Lecrenier
parent b20025c01e
commit 932414bf72
3 changed files with 22 additions and 5 deletions

View File

@ -27,6 +27,10 @@ pub enum Error {
SwapDuplicateIndexesFound(Vec<String>),
#[error("Corrupted dump.")]
CorruptedDump,
#[error(
"Tasks uids must be a comma-separated list of numbers. `{task_uids}` is invalid {error_message}"
)]
InvalidTaskUids { task_uids: String, error_message: String },
#[error("Task `{0}` not found.")]
TaskNotFound(TaskId),
#[error("Query parameters to filter the tasks to delete are missing. Available query parameters are: `uid`, `indexUid`, `status`, `type`.")]
@ -71,6 +75,7 @@ impl ErrorCode for Error {
Error::IndexAlreadyExists(_) => Code::IndexAlreadyExists,
Error::SwapDuplicateIndexesFound(_) => Code::DuplicateIndexFound,
Error::SwapDuplicateIndexFound(_) => Code::DuplicateIndexFound,
Error::InvalidTaskUids { .. } => Code::InvalidTaskUid,
Error::TaskNotFound(_) => Code::TaskNotFound,
Error::TaskDeletionWithEmptyQuery => Code::TaskDeletionWithEmptyQuery,
Error::TaskCancelationWithEmptyQuery => Code::TaskCancelationWithEmptyQuery,