From b5baab70929f8fa7cd83ca51f807d0ebdc3e0a74 Mon Sep 17 00:00:00 2001 From: Jacob Stopak Date: Sun, 21 Apr 2019 15:22:14 -0700 Subject: [PATCH] Move @ResponseBody to class level, bump version to 0.0.2 --- .../pass-exception-to-client-json-spring-boot/pom.xml | 2 +- .../passexceptiontoclientjsonspringboot/ErrorHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-exceptions/pass-exception-to-client-json-spring-boot/pom.xml b/spring-boot-exceptions/pass-exception-to-client-json-spring-boot/pom.xml index 28a699ad98..d592cae351 100644 --- a/spring-boot-exceptions/pass-exception-to-client-json-spring-boot/pom.xml +++ b/spring-boot-exceptions/pass-exception-to-client-json-spring-boot/pom.xml @@ -10,7 +10,7 @@ com.baeldung pass-exception-to-client-json-spring-boot - 0.0.1-SNAPSHOT + 0.0.2-SNAPSHOT pass-exception-to-client-json-spring-boot Baeldung article code on how to pass exceptions to client in JSON format using Spring Boot diff --git a/spring-boot-exceptions/pass-exception-to-client-json-spring-boot/src/main/java/com/baeldung/passexceptiontoclientjsonspringboot/ErrorHandler.java b/spring-boot-exceptions/pass-exception-to-client-json-spring-boot/src/main/java/com/baeldung/passexceptiontoclientjsonspringboot/ErrorHandler.java index 823689adb9..d69f60b75e 100644 --- a/spring-boot-exceptions/pass-exception-to-client-json-spring-boot/src/main/java/com/baeldung/passexceptiontoclientjsonspringboot/ErrorHandler.java +++ b/spring-boot-exceptions/pass-exception-to-client-json-spring-boot/src/main/java/com/baeldung/passexceptiontoclientjsonspringboot/ErrorHandler.java @@ -7,11 +7,11 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; @ControllerAdvice +@ResponseBody public class ErrorHandler { @ExceptionHandler(CustomException.class) @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - @ResponseBody public CustomException handleCustomException(CustomException ce) { return ce;