PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PEAR » PEAR » Bug #4196

Replace PEAR error system

Details

Request #4196Replace PEAR error system
Submitted2005-04-21 13:06 UTC
Frominfo at adaniels dot nl
StatusBogus
PackagePEAR
PHP Version5.0.4
Roadmaps(Not assigned)

Comments

[2005-04-21 13:06 UTC] info at adaniels dot nl

Description:
------------
Pear currently uses a system where any given result may be an PEAR error and should be check before continueing. I believe this is quite outdated, since PHP 5 supports exceptions.

Perhaps the use of exceptions can be enabled using a setting in php.ini to maintain backward compability.

Reproduce code:
---------------
So instead of:
$result = a($b);
if ($PEAR::isError($result)) {
....
} else {
$result = g($h);
if ($PEAR::isError($result)) {
....
} else {
....
}
}

Expected result:
----------------
Much nicer would be:
try {
a($b);
g($h);
} catch (PearException $e) {
....
}

[2005-04-21 13:33 UTC] smith at backendmedia dot com

Furthermore PEAR_Error is by no means outdated. Its just an alternate more flexible, less magic error handling mechanism. You have been brainwashed.