Vote Details for "Error Handling Guidelines for PHP5 packages" by ssb

» Details
» Comment
This document would be better suited as an introduction, it is not a comprehensive guideline. Despite the "Documenting Exceptions" and "Exceptions are part of the API" sections it is not specific enough to have any real meaning as a guideline. Things that are missing:
* how to convert PEAR_Error and PEAR_ErrorStack type errors to exceptions
* PEAR_Exception is mentioned but not defined
* No guidance on when to re-use exising exception classes and when to create your own

Requiring that each package declares one or more classes for exceptions gives no meaning, many packages will do just fine without this.

IMHO the right place to start would be to define the PEAR_Exception API (or just state that it is identical to that of Exception), decide on a set of standard, general, exception classes, and how to convert PEAR errors to PEAR exceptions without losing any information.

Sorry, -1 here