Should we look for exceptions or any other approach?
Since you are committed to PHP5, I think using exceptions in your user libraries is a great idea. Using Try / Catch and Exceptions will provide much better control over your code, as well as potentially more reliable error logging.
Extending the Exclusions class allows you to have a granular level of control over which exceptions your models and libraries can display and how you react to them.
I can imagine that the model threw a dataInputException if it was given a bad input, and a dataOperationException if it could not work with the data (for example, $ this-> db-> insert () returned a failure). How you deal with each type of exception may be different.
As for development bug reports, the Exceptions class methods are going to provide you with a lot of information (like file name and line number).
In addition, some third-party codes use Exceptions (for example, Facebook Connect PHP Lib).
source share