Merge pull request #6937 from eugenp/BAEL-2892-v3

update restcontrolleradvice
This commit is contained in:
Loredana Crusoveanu
2019-05-11 15:54:16 +03:00
committed by GitHub

View File

@@ -1,13 +1,11 @@
package com.baeldung.jsonexception; package com.baeldung.jsonexception;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@ControllerAdvice @RestControllerAdvice
@ResponseBody
public class ErrorHandler { public class ErrorHandler {
@ExceptionHandler(CustomException.class) @ExceptionHandler(CustomException.class)