Re: native error handling in PEAR::DB drivers
| From: | Roman Neuhauser | Date: | Tue, 10 Jun 2003 09:10:22 +0000 |
| Subject: | Re: native error handling in PEAR::DB drivers | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17252@lists.php.net to get a copy of this message | ||
# cox@idecnet.com / 2003-06-10 05:33:48 +0200:
> Nowadays, the errorNative() functions, are used by the {$DBtype}raiseError()
> internaly to set the [userinfo] error message property in the PEAR error
> object returned to the user.
Actually, only sybase (which abuses its broken errorCode()) and ibase
(whose ibaseRaiseError() does what could, and hence should, be left
for raiseError()) call raiseError() in *RaiseError() with the fourth
argument other than explicit null.
raiseError then concats the fourth and fifth arguments into
"%s [nativecode=%s]".
> What would be cool, would be:
>
> 1) to extend the actual DB_error, to store:
>
> DB_error->last_query
> DB_error->db_error_code
> DB_error->db_error_msg
> DB_error->native_error_code
> DB_error->native_error_message
> DB_error->string_dsn
> DB_error->array_dsn
> 2) All the error logic, should be activated (this is included) at error
> time, avoiding the include of PEAR.php and extra error discovering code,
> enhancing the overall speed of the class.
it would be even cooler if errors thrown by the individual drivers'
*RaiseError() methods had the same structure, which is not the case
ATM, and is what I'm working on.
--
If you cc me or remove the list(s) completely I'll most likely ignore
your message. see http://www.eyrie.org./~eagle/faqs/questions.html