I'm starting out with Java and Spring Boot, and I have a fairly simple question that always raises doubts for me, as I always like to follow best practices.

I have a Controller layer where I create the API calls, then a Service layer that implements the business logic, and a repository layer to manage database actions.

The question is: At what level do I throw exceptions? What's the best way to handle exceptions, besides creating custom exceptions?

Thanks

1 Reply 1

I'm sure we have a lot about topic at stackoverflow but I like this site for different Spring questions and guides so https://www.baeldung.com/exception-handling-for-rest-with-spring

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.