} catch (IOException ioException) {
            LOGGER.error("Failed to write response", ioException);
            if (!response.isCommitted()) {
                response.reset();
                response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);