aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Services/UsernameConfictException.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Timeline/Services/UsernameConfictException.cs')
-rw-r--r--Timeline/Services/UsernameConfictException.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/Timeline/Services/UsernameConfictException.cs b/Timeline/Services/UsernameConfictException.cs
new file mode 100644
index 00000000..fde1eda6
--- /dev/null
+++ b/Timeline/Services/UsernameConfictException.cs
@@ -0,0 +1,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; }
+ }
+}