-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[C++][FS][Azure] Remove StatusFromErrorResponse as it's not necessary #39718
Copy link
Copy link
Closed
Description
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++
Reactions are currently unavailable