I run a simple command against Azure Table Storage:
var operation = TableOperation.InsertOrReplace(entity);
await cloudTable.ExecuteAsync(operation);
Now the result that is returned by ExecuteAsync is not just Task
, but Task<TableResult>
. TableResult
contains HttpStatusCode
. Does that mean that operation can just execute without throwing any exception and the status code will be 500 or something and I need to verify these things myself? Or will I only get success codes and exception otherwise.
I can't find any documentation on that one and it's not easy to provoke an error from Table Storage to figure out how it works.
P.S. I use Microsoft.WindowsAzure.Storage.Table
now, but plan to switch to the newly developed library for Cosmos for .Net Core, but it is still beta.
P.P.S. Have figured out that it is used e.g. for 404 when element is not found which is actually expected and not an exception. Also wrong key will result in exception that is probably the result of 403 or 401. Still not clear whether failures will result in exception or not, but all points in the direction that an exception will be thrown.
cloudClient.DefaultRequestOptions.RetryPolicy = myRetryPolicy;
then the need sort of went away. In someetag
type situations with optimistic concurrency was also useful to check. – Belfast