Take the following function as an example of what I want to do: public function save() { $this->connect(‘wb’); try { if(!$this->lock()) throw new Exception(“Unable …
Tag: exception
What are the best practices for catching and re-throwing exceptions?
Should caught exceptions be re-thrown directly, or should they be wrapped around a new exception? That is, should I do this: or this: If your answer is to throw directly please suggest the use of exception chaining, I am not able to understand a real world scenario where we use exception chaining. Answer You should not be catching the exception
How do I display exception errors thrown by Zend framework?
I am working with Zend framework and just hate the fact that I seem to encounter hundreds of exception errors like if I try to reference a non existant property of an object my application just dies …