also swallow exception when container doesn't exist for DeleteIfExists (#1304)

This commit is contained in:
JinmingHu 2021-01-11 13:10:35 +08:00 committed by GitHub
parent 7615a9ee9b
commit f935477e66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -631,7 +631,8 @@ namespace Azure { namespace Storage { namespace Blobs {
}
catch (StorageException& e)
{
if (e.StatusCode == Core::Http::HttpStatusCode::NotFound && e.ErrorCode == "BlobNotFound")
if (e.StatusCode == Core::Http::HttpStatusCode::NotFound
&& (e.ErrorCode == "BlobNotFound" || e.ErrorCode == "ContainerNotFound"))
{
return Azure::Core::Response<Models::DeleteBlobResult>(std::move(e.RawResponse));
}