Re: DB Exceptions - Sample Code
| From: | Lukas Smith | Date: | Thu, 08 Jul 2004 22:39:51 +0000 |
| Subject: | Re: DB Exceptions - Sample Code | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31769@lists.php.net to get a copy of this message | ||
Hans L wrote:
Thanks for the sample code, Aurthur. It definitely helps make for grounded discussion. Arthur Hundiak wrote: What I don't understand is how you can both have configurable error handling *and* use exceptions within your package. For example, I woudln't want to this:Well you cant unless you catch every execption immediatly and therefore making the whole exception things useless. Atleast I dont see a way how. regards, Lukasif (DB::isError($result) || $result === DB_OK) {Not in a PHP5 package when I had ability to use try/catch blocks. I think that exceptions are useful both within packages as well as between them. How do you allow a package to use exceptions internally but have the errors that leave the package be either exceptions or return-code? -- especially when many public methods are being called internally also.return $result;} else {$tmp = new DB_result($this, $result); return $tmp;}