using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;

namespace User.Insight.Tracker.Common
{
    [ExcludeFromCodeCoverage]
    [Serializable]
    public class RoleChangedException : Exception
    {
        public int StatusCode { get; } = 498;

        public RoleChangedException(string message, int statusCode = 498) : base(message)
        {
            StatusCode = statusCode;
        }

        // Recommended serialization constructor
        protected RoleChangedException(SerializationInfo info, StreamingContext context)
        #pragma warning disable SYSLIB0051 // Type or member is obsolete
            : base(info, context)
        #pragma warning restore SYSLIB0051 // Type or member is obsolete
        {
        }
    }
}
