Commit 843334e1 authored by shishir suman's avatar shishir suman
Browse files

bug fixes

Showing with 7 additions and 1 deletion
+7 -1
package org.upsmf.grievance.service.impl; package org.upsmf.grievance.service.impl;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ArrayNode;
...@@ -114,7 +115,12 @@ public class IntegrationServiceImpl implements IntegrationService { ...@@ -114,7 +115,12 @@ public class IntegrationServiceImpl implements IntegrationService {
log.info("Create user Response - {}", response); log.info("Create user Response - {}", response);
if (response.getStatusCode() == HttpStatus.OK) { if (response.getStatusCode() == HttpStatus.OK) {
String userContent = response.getBody().toString(); String userContent = response.getBody().toString();
JsonNode responseNode = mapper.readTree(userContent); JsonNode responseNode = null;
try {
responseNode = mapper.readTree(userContent);
}catch(JsonParseException jp) {
log.error("Error while parsing success response", jp);
}
if(responseNode != null){ if(responseNode != null){
if(responseNode.has("errorMessage")) { if(responseNode.has("errorMessage")) {
throw new RuntimeException(responseNode.get("errorMessage").textValue()); throw new RuntimeException(responseNode.get("errorMessage").textValue());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment