0

This may be silly question but I need to find the C# Azure Storage Exception API that wrap “Common REST API Error codes” https://msdn.microsoft.com/en-us/library/azure/dd179357.aspx.

Say if it is specific exception on a table operation then we can check error code against “Microsoft.WindowsAzure.Storage.Table.Protocol.TableErrorCodeStrings”

I have functionality that wrap creation of Table/Blob/Queue operation in a single method and checking an error type ResourceAlreadyExists while exception handling.

I see this error code ResourceAlreadyExists in Azure Storage Common REST API Error codes as per the documentation but not able to find the corresponding C# Azure Storage API.

Please let me know if you have some insight into this or how can I find it.

2 Answers 2

1

I think you're reading too literally into the REST API documentation. :) Here are the strings for resources that already exist.

Microsoft.WindowsAzure.Storage.Blob.Protocol.BlobErrorCodeStrings.BlobAlreadyExists;
Microsoft.WindowsAzure.Storage.Queue.Protocol.QueueErrorCodeStrings.QueueAlreadyExists;
Microsoft.WindowsAzure.Storage.Table.Protocol.TableErrorCodeStrings.TableAlreadyExists;

So, you will need to check for the appropriate one depending on which Azure storage resource you are working with at that time.

Sign up to request clarification or add additional context in comments.

Comments

1

Those error codes are located in Microsoft.WindowsAzure.Storage.Shared.Protocol.StorageErrorCodeStrings class. Please see the MSDN documentation here and the source code here.

However, please note that these constants are simply set to the error code strings defined in the REST API documentation.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.