parent
049cf3a334
commit
26fdbe3280
|
@ -223,7 +223,7 @@ public class ErrorHandler implements Request.Handler
|
|||
switch (type)
|
||||
{
|
||||
case TEXT_HTML -> writeErrorHtml(request, writer, charset, code, message, cause, showStacks);
|
||||
case TEXT_JSON -> writeErrorJson(request, writer, code, message, cause, showStacks);
|
||||
case TEXT_JSON, APPLICATION_JSON -> writeErrorJson(request, writer, code, message, cause, showStacks);
|
||||
case TEXT_PLAIN -> writeErrorPlain(request, writer, code, message, cause, showStacks);
|
||||
default -> throw new IllegalStateException();
|
||||
}
|
||||
|
|
|
@ -617,10 +617,17 @@ public class ErrorHandlerTest
|
|||
"\r\n");
|
||||
|
||||
HttpTester.Response response = HttpTester.parseResponse(rawResponse);
|
||||
|
||||
assertThat("Response status code", response.getStatus(), is(444));
|
||||
|
||||
assertContent(response);
|
||||
|
||||
rawResponse = connector.getResponse(
|
||||
"GET /badmessage/444 HTTP/1.1\r\n" +
|
||||
"Host: Localhost\r\n" +
|
||||
"Accept: application/json\r\n" +
|
||||
"\r\n");
|
||||
response = HttpTester.parseResponse(rawResponse);
|
||||
assertThat("Response status code", response.getStatus(), is(444));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
|
|
Loading…
Reference in New Issue