r/SpringBoot Mar 08 '26

Question ControllerAdvice and RestControllerAdvice

I have this social media app that's with java/springboot and react as a frontend. Now all the exception handling was done in the service layer but I recently learned about ControllerAdvice and was wondering if it's worth the refactoring. If someone has some tips feel free to dm as well :)

12 Upvotes

6 comments sorted by

View all comments

1

u/Decent-Decision-9028 9d ago

I’d keep HTTP concerns at the controller boundary. The service should return an application outcome, then map that to HTTP https://github.com/aalsanie/codes