2008年11月5日星期三

[fw-db] Why Pdo error codes are not spread ?

Hi all,

I recently notice that when an error occurs in the _execute method statement
of an adapter (Pdo one in my case) a Zend_Db_Statement_Exception is thrown
with the original message of the adapter only :

[code]
} catch (PDOException $e) {
require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage());
}
[/code]

Why the code error is not spread as well ? So that we could rely on a code
to know why the error occured :Constraint integrity violation, Unique key
problem or whatever.

I understand the code number depends on the adapter, so we couldn't rely on
it for all rdbms, but the returned code is zero, so people who don't care
about the error code might just ignore it if the original code would be
passed as parameter in the Zend_Db_Statement_Exception.

Iwould like to have your opinion about it, thank you

Fred
--
View this message in context: http://www.nabble.com/Why-Pdo-error-codes-are-not-spread---tp20339154p20339154.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: