Skip to content

Commit

Permalink
Adding logs to analyse OTP generation API 5xx issue in production (#577)
Browse files Browse the repository at this point in the history
* Adding logs to analyse OTP generation API 5xx issue in production

* Review comments updated
  • Loading branch information
sreeragksgh authored May 29, 2024
1 parent 519871f commit 8a4b713
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public SBApiResponse generateOTP(Map<String, Object> otpRequests) {
Map<String, Object> apiResponse = outboundRequestHandlerService.fetchResultUsingPost(url, otpRequests,
headers);
if (Constants.OK.equalsIgnoreCase((String) apiResponse.get(Constants.RESPONSE_CODE))) {
LOGGER.info("OTP Generation successful");
response.setVer("v1");
response.getParams().setStatus(Constants.SUCCESS.toUpperCase());
response.getParams().setResmsgid(UUID.randomUUID().toString());
Expand All @@ -220,6 +221,7 @@ public SBApiResponse generateOTP(Map<String, Object> otpRequests) {
}
}
if (StringUtils.isNotBlank(errMsg)) {
LOGGER.error("OTP generation request failed, error message : ",errMsg);
response.getParams().setStatus(Constants.FAILED);
response.getParams().setErrmsg(errMsg);
response.setResponseCode(HttpStatus.INTERNAL_SERVER_ERROR);
Expand Down

0 comments on commit 8a4b713

Please sign in to comment.