Skip to content

Commit

Permalink
HashValidator err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mayuradesh committed Jul 10, 2023
1 parent 71bffed commit 921d133
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public ValidationResultDto validateResponse(ValidationInputDto inputDto) {

String errHashReceived = null;
String errGeneratedHashValue = null;
String errPreviousHashValue = null;
if (!arrBiometricNodes.isNull() && arrBiometricNodes.isArray()) {
for (final JsonNode biometricNode : arrBiometricNodes) {
log.info("previousHash {}", previousHash);
Expand Down Expand Up @@ -66,9 +65,11 @@ public ValidationResultDto validateResponse(ValidationInputDto inputDto) {
validationResultDto.setDescription("Validation of hash chain failed across multiple captures."
+ " Previous Hash for last request was {},"
+ " hash generated by validator is {} and hash received is {}");
if ("".equals(previousHash)) {
previousHash = "''";
}
validationResultDto.setDescriptionKey(
"HASH_VALIDATOR_002" + AppConstants.ARGUMENTS_DELIMITER + previousHash == "" ? "''"
: previousHash + AppConstants.ARGUMENTS_SEPARATOR + errGeneratedHashValue
"HASH_VALIDATOR_002" + AppConstants.ARGUMENTS_DELIMITER + previousHash + AppConstants.ARGUMENTS_SEPARATOR + errGeneratedHashValue
+ AppConstants.ARGUMENTS_SEPARATOR + errHashReceived);
validationResultDto.setStatus(AppConstants.FAILURE);
}
Expand Down

0 comments on commit 921d133

Please sign in to comment.