Skip to content

Commit 69d704f

Browse files
authored
Merge pull request #22 from ittovate/fix/exception
Fix fatal error regarding exception handling
2 parents e07fab3 + d4b5614 commit 69d704f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/ittovative/otpservice/exception/GeneralExceptionHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
import org.springframework.http.HttpStatus;
99
import org.springframework.validation.FieldError;
1010
import org.springframework.web.bind.MethodArgumentNotValidException;
11-
import org.springframework.web.bind.annotation.ControllerAdvice;
1211
import org.springframework.web.bind.annotation.ExceptionHandler;
12+
import org.springframework.web.bind.annotation.RestControllerAdvice;
1313

1414
import java.util.HashMap;
1515
import java.util.Map;
1616
import java.util.NoSuchElementException;
1717

18-
@ControllerAdvice
18+
@RestControllerAdvice
1919
public class GeneralExceptionHandler {
2020
/**
2121
* Handle validation exceptions response entity.
@@ -24,7 +24,7 @@ public class GeneralExceptionHandler {
2424
* @return the response entity
2525
*/
2626
@ExceptionHandler(MethodArgumentNotValidException.class)
27-
public APIResponse<Map<String, String>> handleValidationExceptions(
27+
APIResponse<Map<String, String>> handleValidationExceptions(
2828
MethodArgumentNotValidException exception) {
2929

3030
Map<String, String> errors = new HashMap<>();

0 commit comments

Comments
 (0)