mirror of
https://github.com/Example-uPagge/spring-controlleradvice.git
synced 2024-06-14 11:22:33 +03:00
Fix
This commit is contained in:
parent
0b47b9b925
commit
cbc0def973
@ -12,14 +12,14 @@ import org.springframework.web.method.annotation.MethodArgumentTypeMismatchExcep
|
|||||||
public class ExceptionApiHandler {
|
public class ExceptionApiHandler {
|
||||||
|
|
||||||
@ExceptionHandler(NotFoundException.class)
|
@ExceptionHandler(NotFoundException.class)
|
||||||
public ResponseEntity<ErrorMessage> authException(NotFoundException exception) {
|
public ResponseEntity<ErrorMessage> notFoundException(NotFoundException exception) {
|
||||||
return ResponseEntity
|
return ResponseEntity
|
||||||
.status(HttpStatus.NOT_FOUND)
|
.status(HttpStatus.NOT_FOUND)
|
||||||
.body(new ErrorMessage(exception.getMessage()));
|
.body(new ErrorMessage(exception.getMessage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(MethodArgumentTypeMismatchException.class)
|
@ExceptionHandler(MethodArgumentTypeMismatchException.class)
|
||||||
public ResponseEntity<ErrorMessage> authException(MethodArgumentTypeMismatchException exception) {
|
public ResponseEntity<ErrorMessage> mismatchException(MethodArgumentTypeMismatchException exception) {
|
||||||
return ResponseEntity
|
return ResponseEntity
|
||||||
.status(HttpStatus.NOT_FOUND)
|
.status(HttpStatus.NOT_FOUND)
|
||||||
.body(new ErrorMessage(exception.getMessage()));
|
.body(new ErrorMessage(exception.getMessage()));
|
||||||
|
Loading…
Reference in New Issue
Block a user