diff --git a/src/main/java/biz/nynja/account/repositories/AccountRepositoryAdditionalImpl.java b/src/main/java/biz/nynja/account/repositories/AccountRepositoryAdditionalImpl.java index 1737eff41c0046d1c8542817ff789ed006b50c6a..6518636304f793003c2c9e150f408dca02294965 100644 --- a/src/main/java/biz/nynja/account/repositories/AccountRepositoryAdditionalImpl.java +++ b/src/main/java/biz/nynja/account/repositories/AccountRepositoryAdditionalImpl.java @@ -945,7 +945,11 @@ public class AccountRepositoryAdditionalImpl implements AccountRepositoryAdditio ProfileByAuthenticationProvider profileByAuthProvider = profileByAuthenticationProviderRepository .findByAuthenticationProviderAndAuthenticationProviderType(loginOption.getValue(), loginOption.getType()); - if (profileByAuthProvider == null || !profileByAuthProvider.getSearchable().booleanValue()) { + if (profileByAuthProvider == null) { + return Optional.empty(); + } + if (!profileByAuthProvider.getSearchable().booleanValue()) { + logger.info("Record found in DB but is not searchable for the profileId: {}", profileByAuthProvider.getProfileId()); return Optional.empty(); } diff --git a/src/main/java/biz/nynja/account/services/AccountServiceImpl.java b/src/main/java/biz/nynja/account/services/AccountServiceImpl.java index d33e6249e3dd11755c6190599b4571d11c2b2f3b..8f06131fe32667ad72eecdad4fce08fb5c55c3ed 100644 --- a/src/main/java/biz/nynja/account/services/AccountServiceImpl.java +++ b/src/main/java/biz/nynja/account/services/AccountServiceImpl.java @@ -184,7 +184,8 @@ public class AccountServiceImpl extends AccountServiceGrpc.AccountServiceImplBas account = accountProvider.searchAccountByLoginOption(AuthenticationType.EMAIL, request.getEmail()); } catch (IncorrectAccountCountException e) { logAndBuildGrpcSearchResponse(responseObserver, SearchResponse.newBuilder(), - "Error while searching for e-mail: ", request.getEmail(), Cause.INTERNAL_SERVER_ERROR, ""); + "Error while searching for e-mail. {}.", e.getMessage(), Cause.INTERNAL_SERVER_ERROR, "Error while searching for e-mail."); + return; } if (!account.isPresent()) {