Move @ResponseBody to class level, bump version to 0.0.2

This commit is contained in:
Jacob Stopak 2019-04-21 15:22:14 -07:00
parent 2041089e74
commit b5baab7092
2 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@
</parent> </parent>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>pass-exception-to-client-json-spring-boot</artifactId> <artifactId>pass-exception-to-client-json-spring-boot</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.2-SNAPSHOT</version>
<name>pass-exception-to-client-json-spring-boot</name> <name>pass-exception-to-client-json-spring-boot</name>
<description>Baeldung article code on how to pass exceptions to client in JSON format using Spring Boot</description> <description>Baeldung article code on how to pass exceptions to client in JSON format using Spring Boot</description>

View File

@ -7,11 +7,11 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.ResponseStatus;
@ControllerAdvice @ControllerAdvice
@ResponseBody
public class ErrorHandler { public class ErrorHandler {
@ExceptionHandler(CustomException.class) @ExceptionHandler(CustomException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseBody
public CustomException handleCustomException(CustomException ce) { public CustomException handleCustomException(CustomException ce) {
return ce; return ce;