URGENT HELP on PEAR error-handling needed

From: Date: Wed, 12 Dec 2001 18:50:51 +0000
Subject: URGENT HELP on PEAR error-handling needed
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-599@lists.php.net to get a copy of this message
Hi List, I've got a _big_ problem: I'm working on a project (little shop-system) which is about one week past it's deadline (not my fault, of course *g*). Most functionality/classes is/are done but I have many, many comments telling me "TODO insert error-handling... later!" - I always queued that for getting all the other things done at least somewhat in time ;-( Now I need some help on using PEAR's error-handling system. Almost all of my classes inherit form one baseclass which has PEAR as parent-class. Those which don't inherit from that baseclass have a reference to it, so they can call methods that way: $this->_myBase->debug('message', level) (just an example). What I would like to have is one central error-handling-method (in my baseclass, i think) which knows/and get's all the errors. So that if I have to test a value, I use baseclass::isError() and get true if the value is an pear_error or inherited (like DB_Error) from it. On the other hand if there is an error the baseclass does some logging and other error-handling (showing the error-page, perhaps even rolling back db-writes (not by using db::rollback, but by just triggering methods in the class which raised the error) I admit, I didn't much 'googleing' on that and didn't have the time to read the source, so I don't really know if this already is the standard behavior of PEAR::iserror(). All I need are some directions... perhaps some good links (I only found some quite specific on using DB_Error for error-reporting) and some explanation on those PEAR_ERROR_XXX-Constants and how to use them to do different things on different error conditions. Even just some code-fragments could be enough. I wouldn't say i'm desperate, but any help will be really, really great! Thank in advance, Karsten

« previous php.pear.general (#599) next »