Handling Global Exceptions

Use a @RestControllerAdvice class with an @ExceptionHandler to send every error back in one format, 404 for a path that doesn't exist and 500 for anything else.

Updated

Cheat sheet: Handling Global Exceptions
Category
Spring Boot
Level
Freelancer
Tags
rest-api, Spring Boot