aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Services/UsernameConfictException.cs
blob: fde1eda6b985801a44d5b173add599313ba553ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using Timeline.Helpers;

namespace Timeline.Services
{
    /// <summary>
    /// Thrown when the user already exists.
    /// </summary>
    [Serializable]
    public class UsernameConfictException : Exception
    {
        public UsernameConfictException() : base(Resources.Services.Exception.UsernameConfictException) { }
        public UsernameConfictException(string username) : base(Log.Format(Resources.Services.Exception.UsernameConfictException, ("Username", username))) { Username = username; }
        public UsernameConfictException(string username, string message) : base(message) { Username = username; }
        public UsernameConfictException(string message, Exception inner) : base(message, inner) { }
        protected UsernameConfictException(
          System.Runtime.Serialization.SerializationInfo info,
          System.Runtime.Serialization.StreamingContext context) : base(info, context) { }

        /// <summary>
        /// The username that already exists.
        /// </summary>
        public string? Username { get; set; }
    }
}