From 798b37805d6f41abb6a61f995891cc61637fd904 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 12 Oct 2018 15:57:57 +0200 Subject: [PATCH] Polish "Add support for @ResponseStatus in DefaultErrorAttributes" Closes gh-14744 --- .../boot/web/reactive/error/DefaultErrorAttributes.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/error/DefaultErrorAttributes.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/error/DefaultErrorAttributes.java index 48d3dd2724..3054d2d18c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/error/DefaultErrorAttributes.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/error/DefaultErrorAttributes.java @@ -94,14 +94,11 @@ public class DefaultErrorAttributes implements ErrorAttributes { if (error instanceof ResponseStatusException) { return ((ResponseStatusException) error).getStatus(); } - ResponseStatus responseStatus = AnnotatedElementUtils .findMergedAnnotation(error.getClass(), ResponseStatus.class); - if (responseStatus != null) { return responseStatus.code(); } - return HttpStatus.INTERNAL_SERVER_ERROR; } @@ -109,18 +106,14 @@ public class DefaultErrorAttributes implements ErrorAttributes { if (error instanceof WebExchangeBindException) { return error.getMessage(); } - if (error instanceof ResponseStatusException) { return ((ResponseStatusException) error).getReason(); } - ResponseStatus responseStatus = AnnotatedElementUtils .findMergedAnnotation(error.getClass(), ResponseStatus.class); - if (responseStatus != null) { return responseStatus.reason(); } - return error.getMessage(); }