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.
This commit is contained in:
up-to-you 2018-11-07 09:38:34 +01:00 committed by Brian Clozel
parent 27d1af8ffa
commit ae4bc48481
1 changed files with 1 additions and 1 deletions

View File

@ -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());