Concept Flow - Handling not found exceptions
Client sends request
Controller receives request
Service searches for resource
Resource found?
No→Throw NotFoundException
Exception Handler catches
Return resource data
Return 404 response
Send response to client
The client requests a resource; if the resource is missing, a NotFoundException is thrown and caught by a handler that returns a 404 response.