// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

namespace System.Data.Entity.Infrastructure
{
    using System.Data.Entity.Core;
    using System.Data.Entity.Resources;
    using System.Runtime.Serialization;

    /// <summary>
    /// The exception that is thrown when the action failed again after being retried the configured number of times.
    /// </summary>
    [Serializable]
    public sealed class RetryLimitExceededException : EntityException
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RetryLimitExceededException" /> class with no error message.
        /// </summary>
        public RetryLimitExceededException()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="RetryLimitExceededException" /> class with a specified error message.
        /// </summary>
        /// <param name="message">The message that describes the error.</param>
        public RetryLimitExceededException(string message)
            : base(message)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="RetryLimitExceededException" /> class.
        /// </summary>
        /// <param name="message">The message that describes the error.</param>
        /// <param name="innerException">The exception that is the cause of the current exception.</param>
        public RetryLimitExceededException(string message, Exception innerException)
            : base(message, innerException)
        {
        }

        // <summary>
        // Initializes a new instance of the <see cref="RetryLimitExceededException" /> class.
        // </summary>
        // <param name="info">
        // The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.
        // </param>
        // <param name="context">
        // The <see cref="StreamingContext" /> that contains contextual information about the source or destination.
        // </param>
        // <exception cref="ArgumentNullException">
        // The <paramref name="info" /> parameter is null.
        // </exception>
        // <exception cref="SerializationException">
        // The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0).
        // </exception>
        private RetryLimitExceededException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
    }
}
