Skip to content
Ramesh Fadatare edited this page Jun 7, 2018 · 3 revisions

Welcome to the gof-java-design-patterns wiki!

@GET @Path("/getNumber") public String getNumber(@Context HttpHeaders httpheaders, @QueryParam("number") String number) throws Exception { JsonObject json = new JsonObject(); String response = ""; number = number.trim(); try { response = callflowServiceLua.getNumberDetails(number); } catch (Exception e) { logger.debug("StackTrace", e); logger.error(APIResponseMessages.ERROR_GETTING_NUMBER + e.getMessage()); json.addProperty(APIConstants.MESSAGE, APIResponseMessages.ERROR_GETTING_NUMBER + e.getMessage()); if (e.getCause() != null) { json.addProperty(APIConstants.ERROR, e.getCause().getMessage()); } else { json.addProperty(APIConstants.ERROR, APIErrorCodeConstant.INTERNAL_ERROR_CODE); } return json.toString(); } return response; }