I have a symfony project.
There is a website and a rest API that projects all the actions that can be done on the website.
I would like to manage the data handling (get, update, delete) for both website and API on the same code.
I realized that I need to put all the code in the MODEL so that it will be accessible via the API module and the website modules.
How do I handle errors in an Elegant way for both componenets?