简体   繁体   English

Azure表存储异常处理

[英]Azure table storage exception handling

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 . 处理Azure Table Storage引发的Microsoft.WindowsAzure.Storage.StorageException ,有一种无需查询HTTPStatusCodeErrorCode即可确定错误是什么的方法。 For example when trying to insert a duplicate entity the following is raised by Azure : 例如,当尝试插入重复的实体时,Azure将引发以下内容:

HTTPStatusCode : 409 HTTPStatusCode:409

ErrorCode : "EntityAlreadyExists" 错误代码:“ 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 ? 是否可以对这些错误代码进行枚举,而不是直接针对(int) HTTPStatusCode和(string) ErrorCode

看一下TableErrorCodeStrings类,其中列出了所有可能的错误代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM