Skip to content

Commit

Permalink
Re added the removed if block in throwable catch (Addressed comments)
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshiAthapaththu committed Apr 28, 2022
1 parent 8718b4c commit 48a9447
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public Response recoverPasswordPost(RecoveryInitiatingRequestDTO recoveryInitiat
}
RecoveryUtil.handleInternalServerError(Constants.SERVER_ERROR, e.getErrorCode(), LOG, e);
} catch (Throwable throwable) {
if (throwable != null && StringUtils.equals(Constants.ERROR_MESSAGE_EMAIL_NOT_FOUND,
throwable.getMessage())) {
LOG.error(throwable.getMessage(), throwable);
RecoveryUtil.handleBadRequest(throwable.getMessage(), Constants.ERROR_CODE_EMAIL_NOT_FOUND);
}
RecoveryUtil.handleInternalServerError(Constants.SERVER_ERROR, IdentityRecoveryConstants
.ErrorMessages.ERROR_CODE_UNEXPECTED.getCode(), LOG, throwable);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ public Response recoverUsernamePost(List<UserClaimDTO> claim, String tenantDomai
}
RecoveryUtil.handleInternalServerError(Constants.SERVER_ERROR, e.getErrorCode(), LOG, e);
} catch (Throwable throwable) {
if (throwable != null && StringUtils.equals(Constants.ERROR_MESSAGE_EMAIL_NOT_FOUND,
throwable.getMessage())) {
if (LOG.isDebugEnabled()) {
LOG.debug(throwable.getMessage());
}
return Response.ok().build();
}
RecoveryUtil.handleInternalServerError(Constants.SERVER_ERROR, IdentityRecoveryConstants
.ErrorMessages.ERROR_CODE_UNEXPECTED.getCode(), LOG, throwable);
}
Expand Down

0 comments on commit 48a9447

Please sign in to comment.