Skip to content

Commit 8397878

Browse files
committed
Polish
See gh-12838
1 parent d49cc20 commit 8397878

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public void render(Map<String, ?> model, HttpServletRequest request,
225225
response.setContentType(getContentType());
226226
}
227227
builder.append("<html><body><h1>Whitelabel Error Page</h1>").append(
228-
"<p>This application has no configured error view, so you are seeing this as a fallback.</p>")
228+
"<p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p>")
229229
.append("<div id='created'>").append(timestamp).append("</div>")
230230
.append("<div>There was an unexpected error (type=")
231231
.append(htmlEscape(model.get("error"))).append(", status=")

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfigurationTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public void renderContainsViewWithExceptionDetails() throws Exception {
5858
webRequest.getRequest(), webRequest.getResponse());
5959
String responseString = ((MockHttpServletResponse) webRequest.getResponse())
6060
.getContentAsString();
61-
assertThat(responseString).contains("<div>Exception message</div>")
61+
assertThat(responseString).contains(
62+
"<p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p>")
63+
.contains("<div>Exception message</div>")
6264
.contains("<div>java.lang.IllegalStateException");
6365
});
6466
}

spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/SampleActuatorApplicationTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ public void testHtmlErrorPage() {
161161
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR);
162162
String body = entity.getBody();
163163
assertThat(body).as("Body was null").isNotNull();
164-
assertThat(body).contains(
165-
"This application has no configured error view, so you are seeing this as a fallback.");
164+
assertThat(body).contains("This application has no explicit mapping for /error");
166165
}
167166

168167
@Test

0 commit comments

Comments
 (0)