# 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.

![Cheat sheet: Handling Global Exceptions](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/6ad3f86db3d54f08b17cbb49c122386d.webp)

- Category: Spring Boot
- Level: Freelancer
- Tags: rest-api, Spring Boot
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/handling-global-exceptions-cheat-sheet
