Skip to content

Commit

Permalink
Develop mosip 31365 (#1862)
Browse files Browse the repository at this point in the history
* returning proper error message and code whicj we got from idrepo

Signed-off-by: khuddus shariff <[email protected]>

* returning proper error message and code which we got from idrepo

Signed-off-by: khuddus shariff <[email protected]>

* [Mosip-31356] adding log for discarding draft

Signed-off-by: khuddus shariff <[email protected]>

---------

Signed-off-by: khuddus shariff <[email protected]>
  • Loading branch information
Khuddusshariff0022 authored Mar 21, 2024
1 parent 8368f94 commit 1f87a54
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ public boolean idrepoCreateDraft(String id, String uin) throws ApisResourceAcces
ApiName.IDREPOCREATEDRAFT, Lists.newArrayList(id), queryParam, queryParamValue, null, ResponseWrapper.class);
if (response.getErrors() != null && !response.getErrors().isEmpty())
{
List<ErrorDTO> error=response.getErrors();
regProcLogger.error("Error while creating draft for id " + id);
throw new IdrepoDraftException(PlatformErrorMessages.IDREPO_DRAFT_EXCEPTION.getCode(), PlatformErrorMessages.IDREPO_DRAFT_EXCEPTION.getMessage());
throw new IdrepoDraftException(error.get(0).getErrorCode(), error.get(0).getMessage());
}
return (response.getErrors() == null || response.getErrors().isEmpty());
}
Expand Down Expand Up @@ -115,6 +116,7 @@ public IdResponseDTO idrepoUpdateDraft(String id, String uin, IdRequestDto idReq
ApiName.IDREPOUPDATEDRAFT, Lists.newArrayList(id), null, null, idRequestDto, IdResponseDTO.class);
if (response.getErrors() != null && !response.getErrors().isEmpty()) {
regProcLogger.info("Error while updating the drant " + id);
regProcLogger.info(id+" Discarding the draft because of "+response.getErrors().get(0).getMessage());
idrepoDiscardDraft(id);
ErrorDTO error = response.getErrors().get(0);
regProcLogger.error("Error occured while updating draft for id : " + id, error.toString());
Expand Down

0 comments on commit 1f87a54

Please sign in to comment.