Skip to content

Notes on Backend

Shidan Javaheri edited this page May 9, 2023 · 6 revisions

Exception Handling 🔋

Our Application uses Springs Global exception handler to throw a custom exception called a GlobalException. This exception contains both a message and an Http Status. The exception is used as follows:

  • Service methods, which handle the business logic of the application, throw GlobalExceptions with the appropriate message and Http Status. For the most part, they are the only methods that throw these exceptions, though Controller methods may do so in rare cases too

  • Controller methods call service methods, but do not need to worry about exception handling - therefore, there are no try / catch blocks. Exceptions that bubble to the surface are handled completely by Spring

Clone this wiki locally