first let me point out that PEAR is not part of PHP, PEAR is a seperate library that people can use or not use. Pear will not catch PHP errors, Pear errors have to specifically be throws by Pear based objects, and don't mean a thing outside of your Pear application.
PHP's error handling does suck, however the 4.30pre that is out now has options for java and python like try/catch statments. yay! will make your life easier.
The Pear concept is even simpler than you think:
the PEAR_ERROR object is nothing special, it is just agreed upon that when you develop off the pear library you use it, or subclass it.
it is formatted to hold basic error information, and error code, and and error message mostly.
there are several error options:
PEAR_ERROR_RETURN
PEAR_ERROR_PRINT
PEAR_ERROR_DIE
PEAR_ERROR_TRIGGER
PEAR_ERROR_CALLBACK
the default is PEAR_ERROR_RETURN, it means if there is a problem somewhere, the PEAR based object should just return an Error object instead of whatever else it was going to return
what you need to know depends on if you are trying to write a new PEAR based class or just use an existing one....
if you are just trying to use a PEAR class below should give you the most common usage case. One which you should probably use if you don't need the other functionality.
/// assuming PEAR_ERROR_RETURN
$result = somePearBasedThing();
if ( PEAR::isError($result) ) {
echo "<br>Error Code : ". $result->getCode();
echo "<br>Error Message : ". $result->getMessage()
} else {
}
notice how this code doesn't really try to catch any php error that may happen, it just specifically looks for a pear error.
am i way off base with what you wanted from a post?