Azure table storage exception handling

3.2k views Asked by At

When handling a Microsoft.WindowsAzure.Storage.StorageException raised by Azure Table Storage, is there a way of determining what the error is without querying the HTTPStatusCode and the ErrorCode. For example when trying to insert a duplicate entity the following is raised by Azure :

HTTPStatusCode : 409

ErrorCode : "EntityAlreadyExists"

Is there an enumeration of these error codes that I can switch on rather than directly querying against both the (int) HTTPStatusCode and (string) ErrorCode ?

1

There are 1 answers

0
Gaurav Mantri On BEST ANSWER

Take a look at TableErrorCodeStrings class which lists all the possible error codes.