}
catch (DB_AlreadyExistsException $ex) {
This should really be
DB_Exception_AlreadyExists
This does raise an interesting question about how instantate it in code:
... oops something gone wrong..
require_once 'DB/Exception.php';
throw new DB_Exception_AlreadyExists('some message');
or this could be wrapped locally:
$this->throwException('AlreadyExists', 'some message');
(assuming all DB_Exception_* are in DB/Exception.php)
The inheritance tree would look like this?
DB_Exception extends PEAR_Exception {}
DB_Exception_AlreadyExists extends DB_Exception {}
....
While I dont really like having lots of empty classes, it looks like the lesser of all evils :)
Regards
Alan
echo "Duplicate user name (exception)\n";
}
And this isn't a lot more convoluted or than regular return code handling.
Cheers,
Sérgio Carvalho
--
Can you help out?
Need Consulting Services or Know of a Job?
http://www.akbkhome.com