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;