refactored exceptions
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
using ApplicationLayer.GeneralExceptions;
|
||||
using ApplicationLayer.Services.AuthServices.Requests;
|
||||
|
||||
namespace ApplicationLayer.Services.AuthServices.RegisterService.Exceptions
|
||||
{
|
||||
public class UserAlreadyExistsException(RegisterRequest request) : AlreadyExistsException($"User with email '{request.AuthData.Email}' already exists");
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
using ApplicationLayer.GeneralExceptions;
|
||||
|
||||
namespace ApplicationLayer.Services.GeneralExceptions
|
||||
{
|
||||
/// Exception to throw when can't complete some action on entity(delete or something) because it's needed for other entities
|
||||
public class EntityUsedInDatabaseException(string message) : ApiException(message);
|
||||
}
|
||||
@@ -79,11 +79,9 @@ public class VisaApplicationRequestsHandler(
|
||||
var application = await applications.GetByIdAsync(applicationId, cancellationToken);
|
||||
if (application.Status != ApplicationStatus.Pending)
|
||||
{
|
||||
//todo refactor exceptions
|
||||
throw new ApplicationAlreadyProcessedException();
|
||||
}
|
||||
|
||||
//todo handle exception or not
|
||||
ApplicationStatus statusToSet = status switch
|
||||
{
|
||||
AuthorityRequestStatuses.Approved => ApplicationStatus.Approved,
|
||||
|
||||
Reference in New Issue
Block a user