none
Exceptions I can expect when using Table Storage

    Întrebare

  • 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?

    8 martie 2012 00:24

Răspunsuri

  • Hi,

    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:

    http://social.msdn.microsoft.com/Forums/en/adodotnetdataservices/threads


    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.



    8 martie 2012 08:29

Toate mesajele

  • 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.

    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

    8 martie 2012 06:56
  • Hi,

    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:

    http://social.msdn.microsoft.com/Forums/en/adodotnetdataservices/threads


    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.



    8 martie 2012 08:29
  • 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.

    Thanks.

    8 martie 2012 13:51