Fix some error codes

This commit is contained in:
Alex Auvolat
2022-01-05 17:07:36 +01:00
parent fb1e31add0
commit 168a90dfb5
8 changed files with 53 additions and 36 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ async fn handle_delete_internal(
.object_table
.get(&bucket_id, &key.to_string())
.await?
.ok_or(Error::NotFound)?; // No need to delete
.ok_or(Error::NoSuchKey)?; // No need to delete
let interesting_versions = object.versions().iter().filter(|v| {
!matches!(
@@ -40,7 +40,7 @@ async fn handle_delete_internal(
timestamp = std::cmp::max(timestamp, v.timestamp + 1);
}
let deleted_version = version_to_delete.ok_or(Error::NotFound)?;
let deleted_version = version_to_delete.ok_or(Error::NoSuchKey)?;
let version_uuid = gen_uuid();