What is the best practice for throwing an Exception in the following situation:
My URL structure is: /articles/view/id/1
My Controller: AticlesController
And this controller loads a Mapper model: Application_Model_Mapper_Articles
In this model I aggregate all kinds of data. I check several criteria in this model to decide between throwing a 404 error or showing the article.
If I decide to throw the error. How should I do it?
My first guess was throwing it from within the model. But there is no default 'Model_Exception' class and there is a 'Zend_Controller_Action_Exception'. Should I just throw this exception from within the model? Or should I pass the error message back from the model to the controller and then throw the error?