fix the error code of the swap index route

This commit is contained in:
Tamo 2023-01-05 23:21:44 +01:00
parent 3c630891bb
commit e706628bb1
5 changed files with 24 additions and 13 deletions

View file

@ -882,11 +882,11 @@ impl IndexScheduler {
}
if !not_found_indexes.is_empty() {
if not_found_indexes.len() == 1 {
return Err(Error::IndexNotFound(
return Err(Error::SwapIndexNotFound(
not_found_indexes.into_iter().next().unwrap().clone(),
));
} else {
return Err(Error::IndexesNotFound(
return Err(Error::SwapIndexesNotFound(
not_found_indexes.into_iter().cloned().collect(),
));
}