Re: [PEPr] -1 for RFC::Error Handling Guidelines for PHP5 packages

From: Date: Sun, 22 Aug 2004 17:48:57 +0000
Subject: Re: [PEPr] -1 for RFC::Error Handling Guidelines for PHP5 packages
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-32819@lists.php.net to get a copy of this message
Stig, PEAR_Error is deprecated by this RFC. It uses an error return approach, and this section defines that errors must be handled using exceptions: http://wiki.ciaweb.net/yawiki/?area=PEAR_Dev&page=RfcExceptionUse#toc33 In this manner, it is no different from regular error return codes referred in that section, in the second class of error conditions. PEAR_ErrorStack is too recent for me, and apparently most other authors of the RFC to have had any experience with. Although you are extremely late to the discussion (the wiki page was started almost two months ago!), please edit the wiki page and add relevant information. I'll update the proposal accordingly. PEAR_Exception is mentioned and is only required to have exception nesting capabilities. For the purpose of the RFC, its not necessary, and probably just plain confusing, to completely define the PEAR_Exception API. I'll note that there's already code for PEAR_Exception in CVS: http://cvs.php.net/co.php/php-src/pear/PEAR/Exception.php?r=1.4 As for guidance on reusing exceptions, as well as designing exception class hierarchies, that is threading heavily on software design, not coding guidelines. The RFC just requires packages to provide a top-level exception, creating the bare minimum classification of exceptions within PEAR. All classification below that is left at the judgement of the developer. Hope I've cleared your doubts. Cheers, Sérgio Pepr wrote:
Stig Bakken (http://pear.php.net/user/ssb) has voted -1 on the proposal for RFC::Error Handling Guidelines for PHP5 packages. Proposal information: http://pear.php.net/pepr/pepr-proposal-show.php?id=132 Vote information: http://pear.php.net/pepr/pepr-vote-show.php?id=132&handle=ssb 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


Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.pear.dev (#32819) next »