示例#1
0
        internal static TableServiceExceptionAction ProcessTableServiceQueryException(FabricEvents.ExtensionsEvents traceSource, string logSourceId, Exception e, TableServiceAction failedAction)
        {
            traceSource.WriteError(
                logSourceId,
                "Exception encountered when performing operation {0}. Exception information: {1}",
                failedAction,
                e);

            DataServiceQueryException eDataServiceQuery = e as DataServiceQueryException;

            if (null != eDataServiceQuery)
            {
                if (Utility.IsNetworkError(eDataServiceQuery.Response.StatusCode))
                {
                    // We encountered a network error that wasn't resolved even
                    // after retries.
                    throw new MaxRetriesException();
                }
                else
                {
                    return(TableServiceExceptionAction.Abort);
                }
            }

            StorageException eStorage = e as StorageException;

            if (null != eStorage)
            {
                return(ProcessStorageException(eStorage));
            }

            return(TableServiceExceptionAction.Abort);
        }
示例#2
0
        internal static TableServiceExceptionAction ProcessTableServiceRequestException(FabricEvents.ExtensionsEvents traceSource, string logSourceId, Exception e, TableServiceAction failedAction)
        {
            traceSource.WriteError(
                logSourceId,
                "Exception encountered when performing operation {0}. Exception information: {1}",
                failedAction,
                e);

            StorageException eStorage = e as StorageException;

            if (null != eStorage)
            {
                return(ProcessStorageException(eStorage));
            }

            return(TableServiceExceptionAction.Abort);
        }