Exemplo n.º 1
0
        /// <summary>
        /// Create a new <see cref="BuildFailedException"/> instance containing
        /// the information about the currently executing strategy that caused
        /// the exception.
        /// </summary>
        /// <param name="executingStrategy">The <see cref="IBuilderStrategy"/> that was
        /// executing at the time the exception was thrown.</param>
        /// <param name="executingStrategyIndex">The index of the current strategy in its
        /// strategy chain.</param>
        /// <param name="buildKey">The build key being built up.</param>
        /// <param name="innerException">Underlying exception.</param>
        public BuildFailedException(
            IBuilderStrategy executingStrategy,
            int executingStrategyIndex,
            object buildKey,
            Exception innerException)
            : base(null, innerException)
        {
            if (executingStrategy != null)
            {
                executingStrategyTypeName = executingStrategy.GetType().Name;
            }
            this.executingStrategyIndex = executingStrategyIndex;

            if (buildKey != null)
            {
                this.buildKey = buildKey.ToString();
            }
        }