Skip to content

Commit

Permalink
update not found exception
Browse files Browse the repository at this point in the history
  • Loading branch information
emrecoskun705 committed Sep 16, 2023
1 parent 3b4de0e commit 72bdbb2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Unitagram.Application/Exceptions/NotFoundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Unitagram.Application.Exceptions;

public class NotFoundException : Exception
{
public NotFoundException(string name, object key) : base($"{name} ({key}) was not found")
public NotFoundException(string name) : base(name)
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public async Task<UniversityByDomainDto> Handle(GetUniversityByDomainQuery reque

// verify if university exists
if (university is null)
throw new NotFoundException(nameof(University), request.Domain);
throw new NotFoundException(request.Domain);

return university.ToUniversityByDomainDto();
}
Expand Down
2 changes: 1 addition & 1 deletion Unitagram.Identity/Services/AuthService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public async Task<Result<RegisterResponse>> Register(RegisterRequest request)
var getUniversity = await _universityRepository.GetByDomainAsync(getEmailDomain);
if (getUniversity is null)
{
var exception = new NotFoundException("University", getEmailDomain);
var exception = new NotFoundException(getEmailDomain);
return new Result<RegisterResponse>(exception);
}

Expand Down

0 comments on commit 72bdbb2

Please sign in to comment.