public void sendError ( int code , String message , HttpServletResponse response ) { Assert . notNull ( response , "HttpServletResponse argument was null" ) ; try { if ( message != null ) { response . sendError ( code , message ) ; } else { response . sendError ( code ) ; } } catch ( IOException e ) { throw new IllegalStateException ( "Failed to send error code: " + code , e ) ; } }
Sends an error response to the client using the specified HTTP status code .