Custom Error Handling with @ControllerAdvice and @ExceptionHandler - Spring Tutorial

Опубликовано: 18 Март 2026
на канале: Aneesh Mistry
9,744
143

Learn how you can customise the default error response that a Spring REST service can provide to invalid or incomplete API Requests. This video will visit the ResponseEntityExceptionHandler to understand how the error response is created, and will use annotations such as @ControllerAdvice and @ExceptionHandler to build custom responses to specific thrown Exceptions from the REST controller.

🕒 Timestamps 🕒

00:00 - Introduction
00:15 - Errors from API Requests
01:54 - Creating an error response
02:03 - ResponseEntityExceptionHandler
03:44 - Controller Advice
05:15 - Exception Handler
12:05 - Enhancing the response

Link to source code: https://github.com/4neesh/YouTube-Cha...

Please like, subscribe and leave a comment to let me know what you think!

Visit my website for all my blogs and videos on software engineering: www.aneesh.co.uk

Icon made by FreePik from www.flaticon.com