aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Services/JwtBadVersionException.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
commitec7dfb73ace61a1aba5156cc1048cbe32ee1cee6 (patch)
treee6a9d4204e4fcd047cfcf5acd4ff566cf8bb69ff /Timeline/Services/JwtBadVersionException.cs
parent0384a07729fc340852e4e862f431acd66771d48e (diff)
downloadtimeline-ec7dfb73ace61a1aba5156cc1048cbe32ee1cee6.tar.gz
timeline-ec7dfb73ace61a1aba5156cc1048cbe32ee1cee6.tar.bz2
timeline-ec7dfb73ace61a1aba5156cc1048cbe32ee1cee6.zip
...
Diffstat (limited to 'Timeline/Services/JwtBadVersionException.cs')
-rw-r--r--Timeline/Services/JwtBadVersionException.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/Timeline/Services/JwtBadVersionException.cs b/Timeline/Services/JwtBadVersionException.cs
new file mode 100644
index 00000000..4ce17710
--- /dev/null
+++ b/Timeline/Services/JwtBadVersionException.cs
@@ -0,0 +1,36 @@
+using System;
+using Timeline.Helpers;
+
+namespace Timeline.Services
+{
+ [Serializable]
+ public class JwtBadVersionException : Exception
+ {
+ public JwtBadVersionException() : base(Resources.Services.Exception.JwtBadVersionException) { }
+ public JwtBadVersionException(string message) : base(message) { }
+ public JwtBadVersionException(string message, Exception inner) : base(message, inner) { }
+
+ public JwtBadVersionException(long tokenVersion, long requiredVersion)
+ : base(Log.Format(Resources.Services.Exception.JwtBadVersionException,
+ ("Token Version", tokenVersion),
+ ("Required Version", requiredVersion)))
+ {
+ TokenVersion = tokenVersion;
+ RequiredVersion = requiredVersion;
+ }
+
+ protected JwtBadVersionException(
+ System.Runtime.Serialization.SerializationInfo info,
+ System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
+
+ /// <summary>
+ /// The version in the token.
+ /// </summary>
+ public long? TokenVersion { get; set; }
+
+ /// <summary>
+ /// The version required.
+ /// </summary>
+ public long? RequiredVersion { get; set; }
+ }
+}