aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Services/UserNotExistException.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-10-21 20:47:31 +0800
committer杨宇千 <crupest@outlook.com>2019-10-21 20:47:31 +0800
commitc442b7ad597f430b186dd8019de70332b574c4ba (patch)
treee6a9d4204e4fcd047cfcf5acd4ff566cf8bb69ff /Timeline/Services/UserNotExistException.cs
parent4c52f2d8b7aae43f391f54fb67fe91b8bc64e0c5 (diff)
downloadtimeline-c442b7ad597f430b186dd8019de70332b574c4ba.tar.gz
timeline-c442b7ad597f430b186dd8019de70332b574c4ba.tar.bz2
timeline-c442b7ad597f430b186dd8019de70332b574c4ba.zip
...
Diffstat (limited to 'Timeline/Services/UserNotExistException.cs')
-rw-r--r--Timeline/Services/UserNotExistException.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/Timeline/Services/UserNotExistException.cs b/Timeline/Services/UserNotExistException.cs
new file mode 100644
index 00000000..c7317f56
--- /dev/null
+++ b/Timeline/Services/UserNotExistException.cs
@@ -0,0 +1,41 @@
+using System;
+using Timeline.Helpers;
+
+namespace Timeline.Services
+{
+ /// <summary>
+ /// The user requested does not exist.
+ /// </summary>
+ [Serializable]
+ public class UserNotExistException : Exception
+ {
+ public UserNotExistException() : base(Resources.Services.Exception.UserNotExistException) { }
+ public UserNotExistException(string message, Exception inner) : base(message, inner) { }
+
+ public UserNotExistException(string username)
+ : base(Log.Format(Resources.Services.Exception.UserNotExistException, ("Username", username)))
+ {
+ Username = username;
+ }
+
+ public UserNotExistException(long id)
+ : base(Log.Format(Resources.Services.Exception.UserNotExistException, ("Id", id)))
+ {
+ Id = id;
+ }
+
+ protected UserNotExistException(
+ System.Runtime.Serialization.SerializationInfo info,
+ System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
+
+ /// <summary>
+ /// The username of the user that does not exist.
+ /// </summary>
+ public string? Username { get; set; }
+
+ /// <summary>
+ /// The id of the user that does not exist.
+ /// </summary>
+ public long? Id { get; set; }
+ }
+}