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?
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:
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.