RE: [PEAR-DEV] MDB - Error questions
| From: | Lukas Smith | Date: | Fri, 14 Jun 2002 09:01:43 +0000 |
| Subject: | RE: [PEAR-DEV] MDB - Error questions | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7008@lists.php.net to get a copy of this message | ||
Hi,
#1 yeah MDB_Error would be correct
#2 beats me :-)
I really havent gotten PEARs Error handling all the way.
Most of the conversion from Metabase error handling to pear error
handling was done by Christian Dickmann, but I think he just modelled
everything to how PEAR DB does it.
A good tutorial on PEAR Error handling would be much appreciated :-)
Best regards,
Lukas Smith
smith@dybnet.de
_______________________________
DybNet Internet Solutions GbR
Reuchlinstr. 10-11
Gebäude 4 1.OG Raum 6 (4.1.6)
10553 Berlin
Germany
Tel. : +49 30 83 22 50 00
Fax : +49 30 83 22 50 07
www.dybnet.de info@dybnet.de
> -----Original Message-----
> From: Brent Cook [mailto:busterb@mail.utexas.edu]
> Sent: Thursday, June 13, 2002 5:58 PM
> To: Lukas Smith
> Cc: pear-dev@lists.php.net
> Subject: [PEAR-DEV] MDB - Error questions
>
> Hi Lukas,
>
> In MDB.php
>
> function &factory($type)
> {
> @include_once("${type}.php");
>
> $classname = "DB_${type}";
>
> if (!class_exists($classname)) {
> return PEAR::raiseError(NULL, DB_ERROR_NOT_FOUND,
> NULL, NULL, NULL, 'DB_Error',
TRUE);
> }
>
> @$db =& new $classname;
>
> return $db;
> }
>
> Should the class indicated in raiseError be MDB_Error?
>
> Also, what's the difference between doing this:
>
> return PEAR::raiseError(NULL, DB_ERROR_INVALID_DSN, NULL, NULL, 'no
valid
> DBMS driver include path specified', 'MDB_Error', TRUE);
>
> and this:
>
> return PEAR::raiseError('no valid DBMS driver include path specified',
> NULL, DB_ERROR_INVALID_DSN, NULL, NULL, 'MDB_Error');
>
>
> - Brent
>
>
>
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php