Re: AW: [PEAR-DEV] Re: common error handling problem - a PFC issue?
| From: | Alexander Merz | Date: | Tue, 29 Jul 2003 12:18:39 +0000 |
| Subject: | Re: AW: [PEAR-DEV] Re: common error handling problem - a PFC issue? | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev php.pear.qa |
| Request: | Send a blank email to pear-dev+get-18878@lists.php.net to get a copy of this message | ||
Greg Beaver wrote:
still an A20-gate?An error code should be above '10' (just to be prepared...)That's fine. Why 10? :) Because 42 ist too high... Why have 3GHz Prozessors
debugging difficult. The only part I am not sure I do understand is "should never lack to an application user," could you rephrase that? s/lack/pass
What does addUserInfo() do? the manual page says: Adds an user information to the error object.addUserInfo() allows you to store an additional string, ie. to add a more user-understandable message, without loosing the original message. you could do ie: function dbConnect() ... if(PEAR::isError($db)) { $db->addUserInfo("DB isn't currently avaible, please try
later");return $db; } ... } .... $blah=dbConnect(); if(PEAR::isError($blah)) { logError($blah->getMessage(), $blah->getCode()); printError($blah->getUserInfo()); }