private void sendError(HttpServletResponse resp, Exception ex) {
        try {
            LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
            resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        }
        catch (IOException ioex) {
            LOGGER.log(Level.SEVERE, ioex.getMessage(), ioex);
        }
    }
Even though the signatures for methods in a servlet include throws IOException, ServletException, it's a bad
idea to let such exceptions be thrown. Failure to catch exceptions in a servlet could leave a system in a
vulnerable state, possibly resulting in denial-of-service attacks, or the exposure of sensitive information
because when a servlet throws an exception, the servlet container typically sends debugging information back
to the user. And that information could be very valuable to an attacker.

@param resp the HTTP response
@param ex the original exception thrown
primefaces/src/main/java/org/primefaces/webapp/FileUploadChunksServlet.java