sdk/dotnet/src/Microsoft.Datasync.Client/Table/RemoteTable.generic.cs
/// <summary>
/// Executes a request and transfoms a conflict exception.
/// </summary>
/// <param name="action">The asynchronous request to execute.</param>
/// <returns>The result of the execution.</returns>
/// <exception cref="DatasyncConflictException{T}">if the response indicates a conflict.</exception>
Executes a request and transfoms a conflict exception.
Executes a request and transfoms a conflict exception .
private async Task<JToken> TransformHttpExceptionAsync(Func<Task<JToken>> action)
        {
            try
            {
                return await action();
            }
            catch (DatasyncInvalidOperationException ex) when (ex.IsConflictStatusCode())
            {
                try
                {
                    T item = ServiceClient.Serializer.Deserialize<T>(ex.Value);
                    ex = new DatasyncConflictException<T>(ex, item);
                }
                catch
                {
                }
#pragma warning disable RCS1044 
                throw ex;
#pragma warning restore RCS1044 
            }
        }
private async Task < JToken > TransformHttpExceptionAsync ( Func < Task < JToken > > action ) { try { return await action ( ) ; } catch ( DatasyncInvalidOperationException ex ) when ( ex . IsConflictStatusCode ( ) ) { try { T item = ServiceClient . Serializer . Deserialize < T > ( ex . Value ) ; ex = new DatasyncConflictException < T > ( ex , item ) ; } catch { } pragma warning disable RCS1044 throw ex ; pragma warning restore RCS1044 } }
Executes a request and transfoms a conflict exception.
Executes a request and transfoms a conflict exception .
// Deliberately empty to fall-through to throwing the original exception. // We alter the ex in the try/catch above, so RCS1044 is a false-positive. // Remove original exception from throw statement. // Remove original exception from throw statement.
The result of the execution.
The result of the execution .
if the response indicates a conflict.
if the response indicates a conflict .
action
Func<Task<JToken>>
The asynchronous request to execute.
The asynchronous request to execute .