diff --git a/backend/src/main/java/com/redhat/examples/backend/BackendHttpServlet.java b/backend/src/main/java/com/redhat/examples/backend/BackendHttpServlet.java index 7c02acc..657489b 100644 --- a/backend/src/main/java/com/redhat/examples/backend/BackendHttpServlet.java +++ b/backend/src/main/java/com/redhat/examples/backend/BackendHttpServlet.java @@ -45,8 +45,14 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se response.setTime(System.currentTimeMillis()); response.setIp(getIp()); - PrintWriter out = resp.getWriter(); - mapper.writerWithDefaultPrettyPrinter().writeValue(out, response); + PrintWriter out; + try { + out = resp.getWriter(); + mapper.writerWithDefaultPrettyPrinter().writeValue(out, response); + + } catch(IOException ioe) { + throw ioe; + } } private String getIp() {