protected static void error ( final HttpServletResponse httpServletResponse , final String message , final HttpStatus code ) { try { httpServletResponse . setContentType ( "text/plain" ) ; httpServletResponse . setStatus ( code . value ( ) ) ; setNoCache ( httpServletResponse ) ; try ( PrintWriter out = httpServletResponse . getWriter ( ) ) { out . println ( "Error while processing request:" ) ; out . println ( message ) ; } LOGGER . error ( "Error while processing request: {}" , message ) ; } catch ( IOException ex ) { throw ExceptionUtils . getRuntimeException ( ex ) ; } }
Send an error to the client with a message .