elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/storeops/map/AddShardOperation.java [258:306]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @Override
    public StoreResults undoGlobalPostLocalExecute(IStoreTransactionScope ts) {
        return ts.executeOperation(StoreOperationRequestBuilder.SP_BULK_OPERATION_SHARDS_GLOBAL_END,
                StoreOperationRequestBuilder.addShardGlobal(this.getId(), this.getOperationCode(), true, shardMap, shard)); // undo
    }

    /**
     * Handles errors from the undo of GSM operation after LSM operations.
     *
     * @param result
     *            Operation result.
     */
    @Override
    public void handleUndoGlobalPostLocalExecuteError(StoreResults result) {
        if (result.getResult() == StoreResult.ShardMapDoesNotExist) {
            // Remove shard map from cache.
            this.getShardMapManager().getCache().deleteShardMap(shardMap);
        }

        // Possible errors are:
        // StoreResult.ShardMapDoesNotExist
        // StoreResult.StoreVersionMismatch
        // StoreResult.MissingParametersForStoredProcedure
        throw StoreOperationErrorHandler.onShardMapErrorGlobal(result, shardMap, shard, ShardManagementErrorCategory.ShardMap,
                StoreOperationErrorHandler.operationNameFromStoreOperationCode(this.getOperationCode()),
                StoreOperationRequestBuilder.SP_BULK_OPERATION_SHARDS_GLOBAL_END);
    }

    /**
     * Source location of error.
     */
    @Override
    protected ShardLocation getErrorSourceLocation() {
        return shard.getLocation();
    }

    /**
     * Target location of error.
     */
    @Override
    protected ShardLocation getErrorTargetLocation() {
        return shard.getLocation();
    }

    /**
     * Error category for error.
     */
    @Override
    protected ShardManagementErrorCategory getErrorCategory() {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/storeops/recovery/AttachShardOperation.java [256:304]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @Override
    public StoreResults undoGlobalPostLocalExecute(IStoreTransactionScope ts) {
        return ts.executeOperation(StoreOperationRequestBuilder.SP_BULK_OPERATION_SHARDS_GLOBAL_END,
                StoreOperationRequestBuilder.addShardGlobal(this.getId(), this.getOperationCode(), true, shardMap, shard)); // undo
    }

    /**
     * Handles errors from the undo of GSM operation after LSM operations.
     *
     * @param result
     *            Operation result.
     */
    @Override
    public void handleUndoGlobalPostLocalExecuteError(StoreResults result) {
        if (result.getResult() == StoreResult.ShardMapDoesNotExist) {
            // Remove shard map from cache.
            this.getShardMapManager().getCache().deleteShardMap(shardMap);
        }

        // Possible errors are:
        // StoreResult.ShardMapDoesNotExist
        // StoreResult.StoreVersionMismatch
        // StoreResult.MissingParametersForStoredProcedure
        throw StoreOperationErrorHandler.onShardMapErrorGlobal(result, shardMap, shard, ShardManagementErrorCategory.ShardMap,
                StoreOperationErrorHandler.operationNameFromStoreOperationCode(this.getOperationCode()),
                StoreOperationRequestBuilder.SP_BULK_OPERATION_SHARDS_GLOBAL_END);
    }

    /**
     * Source location of error.
     */
    @Override
    protected ShardLocation getErrorSourceLocation() {
        return shard.getLocation();
    }

    /**
     * Target location of error.
     */
    @Override
    protected ShardLocation getErrorTargetLocation() {
        return shard.getLocation();
    }

    /**
     * Error category for store exception.
     */
    @Override
    protected ShardManagementErrorCategory getErrorCategory() {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



