In this post, I will show how we can use the annotation @ControllerAdvice — Controller Advice — an exception handler in the Spring Boot application. If you want to read how to handle uncaught exceptions in Spring Boot, you can check my old post.
Spring 3.2 introduced an annotation
@ControllerAdvice. The annotation allows the handling of exceptions across the application. Before this, Spring offered another annotation
@ExceptionHandler for exception handling. But, you…