From a4a75188bd17e31b39a02511bbd6d628bab5c909 Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 25 Apr 2021 21:20:04 +0800 Subject: ... --- .../Timeline/Services/EntityNotExistException.cs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 BackEnd/Timeline/Services/EntityNotExistException.cs (limited to 'BackEnd/Timeline/Services/EntityNotExistException.cs') 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 +{ + /// + /// Thrown when you want to get an entity that does not exist. + /// + /// + /// For example, you want to get a timeline with given name but it does not exist. + /// + [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; } + } +} -- cgit v1.2.3