Example #1
0
 /// <summary>
 /// Returns the ShardManagementException to be thrown corresponding to a StoreException.
 /// </summary>
 /// <param name="se">Store exception that has been raised.</param>
 /// <returns>ShardManagementException to be thrown.</returns>
 public virtual ShardManagementException OnStoreException(StoreException se)
 {
     return(ExceptionUtils.GetStoreExceptionGlobal(
                this.ErrorCategory,
                se,
                this.OperationName));
 }
 /// <summary>
 /// Returns the ShardManagementException to be thrown corresponding to a StoreException.
 /// </summary>
 /// <param name="se">Store exception that has been raised.</param>
 /// <returns>ShardManagementException to be thrown.</returns>
 public virtual ShardManagementException OnStoreException(StoreException se)
 {
     return(ExceptionUtils.GetStoreExceptionLocal(
                ShardManagementErrorCategory.Recovery,
                se,
                this.OperationName,
                this.Location));
 }
 /// <summary>
 /// Constructs a global store exception object based on the given input parameters.
 /// </summary>
 /// <param name="category">Error category.</param>
 /// <param name="storeException">Underlying store exception.</param>
 /// <param name="operationName">Operation name.</param>
 /// <returns>
 /// ShardManagementException corresponding to the given store exception.
 /// </returns>
 internal static ShardManagementException GetStoreExceptionGlobal(
     ShardManagementErrorCategory category,
     StoreException storeException,
     string operationName)
 {
     return(new ShardManagementException(
                category,
                ShardManagementErrorCode.StorageOperationFailure,
                Errors._Store_SqlExceptionGlobal,
                storeException.InnerException != null ? storeException.InnerException.Message : storeException.Message,
                storeException,
                operationName));
 }
Example #4
0
        /// <summary>
        /// Returns the ShardManagementException to be thrown corresponding to a StoreException.
        /// </summary>
        /// <param name="se">Store Exception that has been raised.</param>
        /// <param name="state">SQL operation state.</param>
        /// <returns>ShardManagementException to be thrown.</returns>
        public virtual ShardManagementException OnStoreException(StoreException se, StoreOperationState state)
        {
            switch (state)
            {
            case StoreOperationState.DoGlobalConnect:

            case StoreOperationState.DoGlobalPreLocalBeginTransaction:
            case StoreOperationState.DoGlobalPreLocalExecute:
            case StoreOperationState.DoGlobalPreLocalCommitTransaction:

            case StoreOperationState.DoGlobalPostLocalBeginTransaction:
            case StoreOperationState.DoGlobalPostLocalExecute:
            case StoreOperationState.DoGlobalPostLocalCommitTransaction:

            case StoreOperationState.UndoGlobalConnect:

            case StoreOperationState.UndoGlobalPreLocalBeginTransaction:
            case StoreOperationState.UndoGlobalPreLocalExecute:
            case StoreOperationState.UndoGlobalPreLocalCommitTransaction:

            case StoreOperationState.UndoGlobalPostLocalBeginTransaction:
            case StoreOperationState.UndoGlobalPostLocalExecute:
            case StoreOperationState.UndoGlobalPostLocalCommitTransaction:
                return(ExceptionUtils.GetStoreExceptionGlobal(
                           this.ErrorCategory,
                           se,
                           this.OperationName));

            case StoreOperationState.DoLocalSourceConnect:
            case StoreOperationState.DoLocalSourceBeginTransaction:
            case StoreOperationState.DoLocalSourceExecute:
            case StoreOperationState.DoLocalSourceCommitTransaction:

            case StoreOperationState.UndoLocalSourceConnect:
            case StoreOperationState.UndoLocalSourceBeginTransaction:
            case StoreOperationState.UndoLocalSourceExecute:
            case StoreOperationState.UndoLocalSourceCommitTransaction:
                return(ExceptionUtils.GetStoreExceptionLocal(
                           this.ErrorCategory,
                           se,
                           this.OperationName,
                           this.ErrorSourceLocation));

            case StoreOperationState.DoLocalTargetConnect:
            case StoreOperationState.DoLocalTargetBeginTransaction:
            case StoreOperationState.DoLocalTargetExecute:
            case StoreOperationState.DoLocalTargetCommitTransaction:

            case StoreOperationState.UndoLocalTargetConnect:
            case StoreOperationState.UndoLocalTargetBeginTransaction:
            case StoreOperationState.UndoLocalTargetExecute:
            case StoreOperationState.UndoLocalTargetCommitTransaction:

            default:
                return(ExceptionUtils.GetStoreExceptionLocal(
                           this.ErrorCategory,
                           se,
                           this.OperationName,
                           this.ErrorTargetLocation));
            }
        }
        /// <summary>
        /// Returns the ShardManagementException to be thrown corresponding to a StoreException.
        /// </summary>
        /// <param name="se">Store Exception that has been raised.</param>
        /// <param name="state">SQL operation state.</param>
        /// <returns>ShardManagementException to be thrown.</returns>
        public virtual ShardManagementException OnStoreException(StoreException se, StoreOperationState state)
        {
            switch (state)
            {
                case StoreOperationState.DoGlobalConnect:

                case StoreOperationState.DoGlobalPreLocalBeginTransaction:
                case StoreOperationState.DoGlobalPreLocalExecute:
                case StoreOperationState.DoGlobalPreLocalCommitTransaction:

                case StoreOperationState.DoGlobalPostLocalBeginTransaction:
                case StoreOperationState.DoGlobalPostLocalExecute:
                case StoreOperationState.DoGlobalPostLocalCommitTransaction:

                case StoreOperationState.UndoGlobalConnect:

                case StoreOperationState.UndoGlobalPreLocalBeginTransaction:
                case StoreOperationState.UndoGlobalPreLocalExecute:
                case StoreOperationState.UndoGlobalPreLocalCommitTransaction:

                case StoreOperationState.UndoGlobalPostLocalBeginTransaction:
                case StoreOperationState.UndoGlobalPostLocalExecute:
                case StoreOperationState.UndoGlobalPostLocalCommitTransaction:
                    return ExceptionUtils.GetStoreExceptionGlobal(
                        this.ErrorCategory,
                        se,
                        this.OperationName);

                case StoreOperationState.DoLocalSourceConnect:
                case StoreOperationState.DoLocalSourceBeginTransaction:
                case StoreOperationState.DoLocalSourceExecute:
                case StoreOperationState.DoLocalSourceCommitTransaction:

                case StoreOperationState.UndoLocalSourceConnect:
                case StoreOperationState.UndoLocalSourceBeginTransaction:
                case StoreOperationState.UndoLocalSourceExecute:
                case StoreOperationState.UndoLocalSourceCommitTransaction:
                    return ExceptionUtils.GetStoreExceptionLocal(
                        this.ErrorCategory,
                        se,
                        this.OperationName,
                        this.ErrorSourceLocation);

                case StoreOperationState.DoLocalTargetConnect:
                case StoreOperationState.DoLocalTargetBeginTransaction:
                case StoreOperationState.DoLocalTargetExecute:
                case StoreOperationState.DoLocalTargetCommitTransaction:

                case StoreOperationState.UndoLocalTargetConnect:
                case StoreOperationState.UndoLocalTargetBeginTransaction:
                case StoreOperationState.UndoLocalTargetExecute:
                case StoreOperationState.UndoLocalTargetCommitTransaction:

                default:
                    return ExceptionUtils.GetStoreExceptionLocal(
                        this.ErrorCategory,
                        se,
                        this.OperationName,
                        this.ErrorTargetLocation);
            }
        }
 /// <summary>
 /// Returns the ShardManagementException to be thrown corresponding to a StoreException.
 /// </summary>
 /// <param name="se">Store exception that has been raised.</param>
 /// <returns>ShardManagementException to be thrown.</returns>
 public virtual ShardManagementException OnStoreException(StoreException se)
 {
     return ExceptionUtils.GetStoreExceptionGlobal(
         this.ErrorCategory,
         se,
         this.OperationName);
 }
 /// <summary>
 /// Returns the ShardManagementException to be thrown corresponding to a StoreException.
 /// </summary>
 /// <param name="se">Store exception that has been raised.</param>
 /// <returns>ShardManagementException to be thrown.</returns>
 public virtual ShardManagementException OnStoreException(StoreException se)
 {
     return ExceptionUtils.GetStoreExceptionLocal(
         ShardManagementErrorCategory.Recovery,
         se,
         this.OperationName,
         this.Location);
 }