From a768a3616382ed2dd8db8ffe062a625c72ada254 Mon Sep 17 00:00:00 2001 From: Francis Pion Date: Sun, 15 Dec 2024 11:04:04 -0500 Subject: [PATCH] IdentityException --- lib/Logitar.Identity.Core/IdentityException.cs | 16 ++++++++++++++++ .../InvalidCredentialsException.cs | 2 +- .../TenantMismatchException.cs | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 lib/Logitar.Identity.Core/IdentityException.cs diff --git a/lib/Logitar.Identity.Core/IdentityException.cs b/lib/Logitar.Identity.Core/IdentityException.cs new file mode 100644 index 0000000..ca8a836 --- /dev/null +++ b/lib/Logitar.Identity.Core/IdentityException.cs @@ -0,0 +1,16 @@ +namespace Logitar.Identity.Core; + +/// +/// The base class of Identity exceptions. +/// +public abstract class IdentityException : Exception +{ + /// + /// Initializes a new instance of the class. + /// + /// The exception message. + /// The inner exception. + protected IdentityException(string message, Exception? innerException = null) : base(message, innerException) + { + } +} diff --git a/lib/Logitar.Identity.Core/InvalidCredentialsException.cs b/lib/Logitar.Identity.Core/InvalidCredentialsException.cs index e4f3c0f..2e65c0f 100644 --- a/lib/Logitar.Identity.Core/InvalidCredentialsException.cs +++ b/lib/Logitar.Identity.Core/InvalidCredentialsException.cs @@ -3,7 +3,7 @@ /// /// The exception raised when credential validation failed. /// -public class InvalidCredentialsException : Exception +public class InvalidCredentialsException : IdentityException { /// /// A generic error message for this exception. diff --git a/lib/Logitar.Identity.Core/TenantMismatchException.cs b/lib/Logitar.Identity.Core/TenantMismatchException.cs index 816e077..b91f47c 100644 --- a/lib/Logitar.Identity.Core/TenantMismatchException.cs +++ b/lib/Logitar.Identity.Core/TenantMismatchException.cs @@ -3,7 +3,7 @@ /// /// The exception raised when an association is made between two entities in different tenants. /// -public class TenantMismatchException : Exception +public class TenantMismatchException : IdentityException { /// /// A generic error message for this exception.