Fix stack-trace line breaks in whitelabel error views

Since gh-12838, the WebFlux whitelabel error view also shows the
stacktrace information if it is available in the model.

This commit adds a CSS directive that preserves white spaces and breaks
lines at newline characters.
pull/15130/head
up-to-you 6 years ago committed by Brian Clozel
parent 27d1af8ffa
commit ae4bc48481

@ -202,7 +202,7 @@ public abstract class AbstractErrorWebExceptionHandler
builder.append("<div>").append(htmlEscape(message)).append("</div>");
}
if (trace != null) {
builder.append("<div>").append(htmlEscape(trace)).append("</div>");
builder.append("<div style='white-space:pre-wrap;'>").append(htmlEscape(trace)).append("</div>");
}
builder.append("</body></html>");
return responseBody.syncBody(builder.toString());

Loading…
Cancel
Save