/** * Determine if the stacktrace attribute should be included. * @param request the source request * @param produces the media type produced (or {@code MediaType.ALL}) * @return if the stacktrace attribute should be included */ protected boolean isIncludeStackTrace(HttpServletRequest request, MediaType produces) { IncludeStacktrace include = getErrorProperties().getIncludeStacktrace(); if (include == IncludeStacktrace.ALWAYS) { return true; } if (include == IncludeStacktrace.ON_TRACE_PARAM) { return getTraceParameter(request); } return false; }
protected boolean isIncludeStackTrace(HttpServletRequest request) { IncludeStacktrace include = this.errorProperties.getIncludeStacktrace(); if (include == IncludeStacktrace.ALWAYS) { return true; } if (include == IncludeStacktrace.ON_TRACE_PARAM) { return getTraceParameter(request); } return false; }
@Bean public ErrorProperties errorProperties() { final ErrorProperties properties = new ErrorProperties(); properties.setIncludeStacktrace(IncludeStacktrace.ALWAYS); return properties; }