2012년 3월 8일 목요일 오전 12:24
In handling errors from Table Storage using the .Net StorageClient it is not clear to me what exceptions I can expect to receive. I see three distinct exceptions defined in the System.Data.Services.Client namespace, they are: DataServiceClientException, DataServiceQueryException and DataServiceRequestException. The descriptions of these in the MSDN docs do not shed a whole lot of light on them for me. In trying to interpret the names I could see DataServiceQueryException being used when there is a problem querying from Table Storage and DataServiceRequestException being used when trying to write to Table Storage.
But is that true? And if so what is the more generic DataServiceClientException used for? Can anyone shed any light on what I should expect to see and when?
2012년 3월 8일 목요일 오전 6:56중재자I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay.
Appreciate your patience.
2012년 3월 8일 목요일 오전 8:29중재자
In WCF Data Services assemblies the DataServiceClientException is usually wrapped by the DataServiceQueryException/DataServiceRequestException as the inner exception. The differences between DataServiceQueryException and DataServiceRequestException from developers' point of view:
DataServiceQueryException: Only can be thrown when you call DataServiceContext.Execute(), DataServiceContext.LoadProperty() methods. (And their async counterparts)
DataServiceRequestException: Only can be thrown when you call DataServiceContext.ExecuteBatch(), DataServiceContext.SaveChanges() methods. (And their async counterparts)
Actually this is a WCF Data Services question instead of Azure question so if you have further questions please ask in WCF Data Services forum:
Allen Chen [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
2012년 3월 8일 목요일 오후 1:51
Thanks Allen. I think your response mostly confirms what I was thinking. That is that DataServiceRequestException is used for insert/update commands, whereas DataServiceQueryException is used for selects. I assume there is probably some subtlety there but this gives me a good start.