[英]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
,有一种无需查询HTTPStatusCode
和ErrorCode
即可确定错误是什么的方法。 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.