diff options
author | 2020-03-19 11:59:02 +0000 | |
---|---|---|
committer | 2020-03-19 11:59:02 +0000 | |
commit | 3e90fc1056791e629916a29b12b7b14bcb1e2f15 (patch) | |
tree | 7ee7eadcdc665396f5456537a17f01b064841b06 /vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/error/VTPExceptionMapper.java | |
parent | 2b913c12ea8ff1108782132f540333219537c837 (diff) | |
parent | 427fb7539233ece7759e27e04fa3b11d17b66ea7 (diff) |
Merge "Migrate to gson"
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/error/VTPExceptionMapper.java')
-rw-r--r-- | vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/error/VTPExceptionMapper.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/error/VTPExceptionMapper.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/error/VTPExceptionMapper.java index 93f08a4f..0287f339 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/error/VTPExceptionMapper.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/error/VTPExceptionMapper.java @@ -26,8 +26,7 @@ import org.onap.vtp.error.VTPError.VTPException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; +import com.google.gson.JsonObject; @Provider @Singleton @@ -41,9 +40,9 @@ public class VTPExceptionMapper implements ExceptionMapper<Exception> { VTPException ex = (VTPException) e; return Response.status(ex.getVTPError().getHttpStatus()).entity(ex.getVTPError().toString()).build(); } else { - ObjectNode node = JsonNodeFactory.instance.objectNode(); - node.put("message", e.getMessage()); - node.put("code", "UNKNOWN"); + JsonObject node = new JsonObject(); + node.addProperty("message", e.getMessage()); + node.addProperty("code", "UNKNOWN"); return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR).entity(node.toString()).build(); } |