diff options
author | crupest <crupest@outlook.com> | 2021-04-25 21:20:04 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-04-25 21:20:04 +0800 |
commit | 657fb589137099794e58fbd35beb7d942b376965 (patch) | |
tree | 7ab03d970f4c556b0a005f94da2e0752e9d7ce99 /BackEnd/Timeline/Services/EntityNotExistException.cs | |
parent | b64806226723df9a9deb64e80defc93860896f50 (diff) | |
download | timeline-657fb589137099794e58fbd35beb7d942b376965.tar.gz timeline-657fb589137099794e58fbd35beb7d942b376965.tar.bz2 timeline-657fb589137099794e58fbd35beb7d942b376965.zip |
...
Diffstat (limited to 'BackEnd/Timeline/Services/EntityNotExistException.cs')
-rw-r--r-- | BackEnd/Timeline/Services/EntityNotExistException.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Services/EntityNotExistException.cs b/BackEnd/Timeline/Services/EntityNotExistException.cs new file mode 100644 index 00000000..39a4f545 --- /dev/null +++ b/BackEnd/Timeline/Services/EntityNotExistException.cs @@ -0,0 +1,27 @@ +using System;
+
+namespace Timeline.Services
+{
+ /// <summary>
+ /// Thrown when you want to get an entity that does not exist.
+ /// </summary>
+ /// <example>
+ /// For example, you want to get a timeline with given name but it does not exist.
+ /// </example>
+ [Serializable]
+ public class EntityNotExistException : Exception
+ {
+ public EntityNotExistException() : this(null, null) { }
+ public EntityNotExistException(string? entityName) : this(entityName, null) { }
+ public EntityNotExistException(string? entityName, Exception? inner) : this(entityName, null, inner) { }
+ public EntityNotExistException(string? entityName, string? message, Exception? inner) : base(message ?? Resource.ExceptionEntityNotExist, inner)
+ {
+ EntityName = entityName;
+ }
+ protected EntityNotExistException(
+ System.Runtime.Serialization.SerializationInfo info,
+ System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
+
+ public string? EntityName { get; }
+ }
+}
|