initial commit
This commit is contained in:
8
Application/Exceptions/BaseException.cs
Normal file
8
Application/Exceptions/BaseException.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Domain.Enums;
|
||||
|
||||
namespace Application.Exceptions;
|
||||
|
||||
public class BaseException(EErrorCategory category, string message) : Exception(message)
|
||||
{
|
||||
public readonly EErrorCategory Category = category;
|
||||
}
|
||||
8
Application/Exceptions/DuplicateEmailException.cs
Normal file
8
Application/Exceptions/DuplicateEmailException.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Domain.Enums;
|
||||
|
||||
namespace Application.Exceptions;
|
||||
|
||||
public class DuplicateEmailException(string email) : BaseException(EErrorCategory.UserValidationError, $"Email {email} already registered")
|
||||
{
|
||||
|
||||
}
|
||||
8
Application/Exceptions/DuplicateUsernameException.cs
Normal file
8
Application/Exceptions/DuplicateUsernameException.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Domain.Enums;
|
||||
|
||||
namespace Application.Exceptions;
|
||||
|
||||
public class DuplicateUsernameException(string? username) : BaseException(EErrorCategory.UserValidationError, $"Username {username} is taken")
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using Domain.Enums;
|
||||
|
||||
namespace Application.Exceptions;
|
||||
|
||||
public class InsufficientParametersException(List<string> missingParameters) : BaseException(EErrorCategory.RequestError, "Insufficient Parameters: " + string.Join(", ", missingParameters))
|
||||
{
|
||||
|
||||
}
|
||||
8
Application/Exceptions/UserNotFoundException.cs
Normal file
8
Application/Exceptions/UserNotFoundException.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Domain.Enums;
|
||||
|
||||
namespace Application.Exceptions;
|
||||
|
||||
public class UserNotFoundException(int id) : BaseException(EErrorCategory.DataNotFoundError,$"User with ID {id} not found.")
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user