how to handle exceptions in rest api exception handling in rest api Programs Sunny goel 2022-Feb-01 1 Answers
Answers ( 1 )
Exception can be handled in a class annotated with @ControllerAdvice.
In this class you can write methods which will handle particular type of exception.
So based on the exception thrown we can write a corresponding handling method in that class and it will be handled accordingly.