Skip to content

Commit

Permalink
UnComment throw new Business Exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadKarimi committed Jan 14, 2024
1 parent d69692f commit 2274bf8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/SwiftLink.Application/Behaviors/ValidationBehavior.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using FluentValidation;
using MediatR;
using Microsoft.IdentityModel.Tokens;
using SwiftLink.Application.Common;
using SwiftLink.Application.Common.Exceptions;
using System.ComponentModel.DataAnnotations;

namespace SwiftLink.Application.Behaviors;

Expand All @@ -22,8 +20,8 @@ public async Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TRe
.Select(validationFailure => new ValidationError(validationFailure.PropertyName, validationFailure.ErrorMessage))
.ToList();

//if (errors.Count != 0)
// throw new BusinessValidationException(errors);
if (errors.Count != 0)
throw new BusinessValidationException(errors);

var response = await next();
return response;
Expand Down

0 comments on commit 2274bf8

Please sign in to comment.