protected void exceptionResponse(HttpServletRequest req, HttpServletResponse resp, Throwable t, int status) {
		final String sourceMethod = "exceptionResponse"; //$NON-NLS-1$
		resp.addHeader("Cache-control", "no-store"); //$NON-NLS-1$ //$NON-NLS-2$
		Level logLevel = (t instanceof BadRequestException || t instanceof NotFoundException)
				? Level.WARNING : Level.SEVERE;
		logException(req, logLevel, sourceMethod, t);
		if (getOptions().isDevelopmentMode() || getOptions().isDebugMode()) {
			// In development mode, display server exceptions on the browser console
			String msg = StringUtil.escapeForJavaScript(
					MessageFormat.format(
							Messages.ExceptionResponse,
							new Object[]{
									t.getClass().getName(),
									t.getMessage() != null ? StringUtil.escapeForJavaScript(t.getMessage()) : "" //$NON-NLS-1$
							}
							)
					);
			String content = "console.error('" + msg + "');";  //$NON-NLS-1$ //$NON-NLS-2$
			try {
				CopyUtil.copy(new StringReader(content), resp.getOutputStream());
			} catch (IOException e1) {
				if (log.isLoggable(Level.SEVERE)) {
					log.log(Level.SEVERE, e1.getMessage(), e1);
				}
				resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
			}
		} else {
			resp.setStatus(status);
		}
	}
protected void exceptionResponse ( HttpServletRequest req , HttpServletResponse resp , Throwable t , int status ) { final String sourceMethod = "exceptionResponse" ; resp . addHeader ( "Cache-control" , "no-store" ) ; Level logLevel = ( t instanceof BadRequestException || t instanceof NotFoundException ) ? Level . WARNING : Level . SEVERE ; logException ( req , logLevel , sourceMethod , t ) ; if ( getOptions ( ) . isDevelopmentMode ( ) || getOptions ( ) . isDebugMode ( ) ) { String msg = StringUtil . escapeForJavaScript ( MessageFormat . format ( Messages . ExceptionResponse , new Object [ ] { t . getClass ( ) . getName ( ) , t . getMessage ( ) != null ? StringUtil . escapeForJavaScript ( t . getMessage ( ) ) : "" } ) ) ; String content = "console.error('" + msg + "');" ; try { CopyUtil . copy ( new StringReader ( content ) , resp . getOutputStream ( ) ) ; } catch ( IOException e1 ) { if ( log . isLoggable ( Level . SEVERE ) ) { log . log ( Level . SEVERE , e1 . getMessage ( ) , e1 ) ; } resp . setStatus ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR ) ; } } else { resp . setStatus ( status ) ; } }
Sets response status and headers for an error response based on the information in the
specified exception. If development mode is enabled, then returns a 200 status with a
console.error() message specifying the exception message

@param req
the request object
@param resp
The response object
@param t
The exception object
@param status
The response status