Merge pull request #6937 from eugenp/BAEL-2892-v3
update restcontrolleradvice
This commit is contained in:
commit
734692d393
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue