Minor refactoring after recent commits

See gh-29384
This commit is contained in:
rstoyanchev
2022-11-01 13:56:40 +00:00
parent e71057dca9
commit 921eeadff4
4 changed files with 16 additions and 17 deletions

View File

@@ -306,12 +306,11 @@ public abstract class ResponseEntityExceptionHandler implements MessageSourceAwa
* @return the created {@code ProblemDetail} instance
*/
protected ProblemDetail createProblemDetail(
Exception ex, HttpStatusCode status, @Nullable HttpHeaders headers,
String defaultDetail, @Nullable String detailMessageCode, @Nullable Object[] detailMessageArguments,
ServerWebExchange exchange) {
Exception ex, HttpStatusCode status, String defaultDetail, @Nullable String detailMessageCode,
@Nullable Object[] detailMessageArguments, ServerWebExchange exchange) {
ErrorResponse response = ErrorResponse.createFor(
ex, status, headers, defaultDetail, detailMessageCode, detailMessageArguments);
ex, status, null, defaultDetail, detailMessageCode, detailMessageArguments);
return response.updateAndGetBody(this.messageSource, getLocale(exchange));
}

View File

@@ -279,7 +279,7 @@ public class ResponseEntityExceptionHandlerTests {
public Mono<ResponseEntity<Object>> handleException(IllegalStateException ex, ServerWebExchange exchange) {
HttpStatus status = HttpStatus.INTERNAL_SERVER_ERROR;
ProblemDetail body = createProblemDetail(ex, status, null, ex.getMessage(), null, new Object[] {"A"}, exchange);
ProblemDetail body = createProblemDetail(ex, status, ex.getMessage(), null, new Object[] {"A"}, exchange);
return handleExceptionInternal(ex, body, null, status, exchange);
}
}