Yes, I would recommend using the Exception subtypes provided by SPL. It allows calling code (either in a framework or in your app) to handle different types of exceptions differently.
A DomainException
might indicate invalid user input, which you should report to the user and give them a chance to re-enter data. A BadMethodCallException
may indicate a flaw in your code, and you should log it and handle it a different way.
But these different exception scenarios have nothing to do with the class or component that threw the exception. A BadMethodCallException
should probably be handled similarly whether it happens in an MVC component or a DB access layer.
I was the project lead on the Zend Framework through its 1.0 release. I wanted to reorganize the exception hierarchy, and I thought it was an arbitrary decision (prior to my joining the project) to use a single exception for every component. It didn't make sense.
Unfortunately, rearchitecting the exceptions wasn't as important as getting the product to its 1.0 release milestone. I had to follow the priority on schedule that Zend set for the project, and to do that, practically everything that wasn't strictly necessary to get to the feature-complete release had to be deferred.