Describe the enhancement requested
Only the "*IfExists" functions from the Azure SDK ever set response.Value.Deleted to false to indicate that a resource wasn't found and the request succeeded without deleting anything.
This is the implementation of DataLakePathClient::DeleteIfExists:
Azure::Response<Models::DeletePathResult> DataLakePathClient::DeleteIfExists(
const DeletePathOptions& options,
const Azure::Core::Context& context) const
{
try
{
return Delete(options, context);
}
catch (StorageException& e)
{
if (e.ErrorCode == _detail::DataLakeFilesystemNotFound
|| e.ErrorCode == _detail::DataLakePathNotFound)
{
Models::DeletePathResult ret;
ret.Deleted = false;
return Azure::Response<Models::DeletePathResult>(std::move(ret), std::move(e.RawResponse));
}
throw;
}
}
It's better that we use the Delete() versions of these functions instead of DeleteIfExists and check the ErrorCode ourselves to return an appropriate Status instead of something generic.
Component(s)
C++
Describe the enhancement requested
Only the "*IfExists" functions from the Azure SDK ever set
response.Value.Deletedtofalseto indicate that a resource wasn't found and the request succeeded without deleting anything.This is the implementation of
DataLakePathClient::DeleteIfExists:It's better that we use the
Delete()versions of these functions instead ofDeleteIfExistsand check theErrorCodeourselves to return an appropriateStatusinstead of something generic.Component(s)
C++