Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.17k stars 4.53k forks source link

[FEATURE REQ] Handle http 409 without exception handler #40800

Open snps9100 opened 6 months ago

snps9100 commented 6 months ago

Library name

Azure.Storage.Files.DataLake

Please describe the feature.

var options = new DataLakeFileUploadOptions { Conditions = new DataLakeRequestConditions { IfNoneMatch = Azure.ETag.All } }; await fsClient.GetFileClient(blobPath).UploadAsync(File.OpenRead(filePath), options);

The above code will cause the azure api to return a http 409 status if the file already exists, and the library will throw an Azure.RequestFailedException with status 409. This works, but i dont like using exceptions for flow control ...

It would be nice to have an option to not throw that exception (maybe its there but i overlooked it?), and just be able to inspect the Azure.Response object.

github-actions[bot] commented 6 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @sumantmehtams.

github-actions[bot] commented 6 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @sumantmehtams.

davyvanlaere commented 1 month ago

Is this something that will be addressed in a future release?