Closed riencus closed 7 years ago
since we only have about 2 weeks to finish the entire project, do we have enough time to refactor all service?
Well, We can do it partially though. Refactor only the service that we are working on at that time. Adding this class won't break the system. Like what I said in the PR notes, a Controller advice will catch the exception thrown by a controller. If there's no controller that throws any exception, it will never be called.
Another Pros that I forgot to mention, it gives swagger-ui
a better response documentation.
In this PR I introduced a new class which annotated with
@RestControllerAdvice
namedAthensControllerAdvice
.This class will catch all exception thrown by controller and return a specified response.
Pros: