Add more errors
This commit is contained in:
@@ -56,14 +56,12 @@ public class UserService : IUserService
|
||||
|
||||
if (!_authorizedAddresses.Any(a => string.Equals(a, recoveredAddress, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
_logger.LogWarning($"Address {recoveredAddress} not authorized");
|
||||
throw new Exception("Address not authorized");
|
||||
throw new Exception($"Address {recoveredAddress} not authorized");
|
||||
}
|
||||
|
||||
if (recoveredAddress == null || !recoveredAddress.Equals(address))
|
||||
{
|
||||
_logger.LogWarning($"Address {recoveredAddress} not corresponding");
|
||||
throw new Exception("Address not corresponding");
|
||||
throw new Exception($"Address {recoveredAddress} not corresponding");
|
||||
}
|
||||
|
||||
// Check if account exist
|
||||
@@ -72,7 +70,7 @@ public class UserService : IUserService
|
||||
if (user != null)
|
||||
{
|
||||
if (!user.Name.Equals(name))
|
||||
throw new Exception("Name not corresponding");
|
||||
throw new Exception("Name not corresponding to user " + name);
|
||||
|
||||
// User and account found
|
||||
user.Accounts = _accountService.GetAccountsByUser(user).ToList();
|
||||
@@ -82,7 +80,7 @@ public class UserService : IUserService
|
||||
|
||||
if (account == null)
|
||||
{
|
||||
throw new Exception("Account not found");
|
||||
throw new Exception("Account not found for address " + recoveredAddress);
|
||||
}
|
||||
|
||||
return user;
|
||||
|
||||
Reference in New Issue
Block a user