Ebyrdeu / spring_boot_library

0 stars 0 forks source link

Create Global error handlers #11

Closed Ebyrdeu closed 8 months ago

Ebyrdeu commented 8 months ago

Problem Description

Spring Boot does not have a built-in NotFoundException or any similar kind; therefore, we need to create our own.

All exceptions need to be in the package src/main/java/dev/ebrydeu/spring_boot_library/exception.

https://www.baeldung.com/exception-handling-for-rest-with-spring

Ebyrdeu commented 8 months ago

Small update. use @ControllerAdvice for custom exceptions, here is a better article about it.