|
|
@ -173,14 +173,11 @@ public class DefaultErrorWebExceptionHandler extends AbstractErrorWebExceptionHa
|
|
|
|
* @return if the stacktrace attribute should be included
|
|
|
|
* @return if the stacktrace attribute should be included
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
protected boolean isIncludeStackTrace(ServerRequest request, MediaType produces) {
|
|
|
|
protected boolean isIncludeStackTrace(ServerRequest request, MediaType produces) {
|
|
|
|
switch (this.errorProperties.getIncludeStacktrace()) {
|
|
|
|
return switch (this.errorProperties.getIncludeStacktrace()) {
|
|
|
|
case ALWAYS:
|
|
|
|
case ALWAYS -> true;
|
|
|
|
return true;
|
|
|
|
case ON_PARAM -> isTraceEnabled(request);
|
|
|
|
case ON_PARAM:
|
|
|
|
default -> false;
|
|
|
|
return isTraceEnabled(request);
|
|
|
|
};
|
|
|
|
default:
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -190,14 +187,11 @@ public class DefaultErrorWebExceptionHandler extends AbstractErrorWebExceptionHa
|
|
|
|
* @return if the message attribute should be included
|
|
|
|
* @return if the message attribute should be included
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
protected boolean isIncludeMessage(ServerRequest request, MediaType produces) {
|
|
|
|
protected boolean isIncludeMessage(ServerRequest request, MediaType produces) {
|
|
|
|
switch (this.errorProperties.getIncludeMessage()) {
|
|
|
|
return switch (this.errorProperties.getIncludeMessage()) {
|
|
|
|
case ALWAYS:
|
|
|
|
case ALWAYS -> true;
|
|
|
|
return true;
|
|
|
|
case ON_PARAM -> isMessageEnabled(request);
|
|
|
|
case ON_PARAM:
|
|
|
|
default -> false;
|
|
|
|
return isMessageEnabled(request);
|
|
|
|
};
|
|
|
|
default:
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -207,14 +201,11 @@ public class DefaultErrorWebExceptionHandler extends AbstractErrorWebExceptionHa
|
|
|
|
* @return if the errors attribute should be included
|
|
|
|
* @return if the errors attribute should be included
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
protected boolean isIncludeBindingErrors(ServerRequest request, MediaType produces) {
|
|
|
|
protected boolean isIncludeBindingErrors(ServerRequest request, MediaType produces) {
|
|
|
|
switch (this.errorProperties.getIncludeBindingErrors()) {
|
|
|
|
return switch (this.errorProperties.getIncludeBindingErrors()) {
|
|
|
|
case ALWAYS:
|
|
|
|
case ALWAYS -> true;
|
|
|
|
return true;
|
|
|
|
case ON_PARAM -> isBindingErrorsEnabled(request);
|
|
|
|
case ON_PARAM:
|
|
|
|
default -> false;
|
|
|
|
return isBindingErrorsEnabled(request);
|
|
|
|
};
|
|
|
|
default:
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|