PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB » Bug #607

Can getMessage contain the Oracle error text?

Details

Submitted2004-01-21 22:41 UTC
Fromcjbj at hotmail dot com
Assigneddanielc
StatusClosed
PackageDB
PHP Version4.3.4
OSWindows 2000
Roadmaps(Not assigned)

Comments

[2004-01-21 22:41 UTC] cjbj at hotmail dot com

Description:
------------
It would help users if PEAR's DB oci8 driver put the Oracle error text
in the getMessage method inplace of the generic PEAR DB message. This
would make it easier for users to self-correct any problems. For
example instead of getting the message "DB Error: connect failed",
they would be able to tell if they had entered the wrong username and
password, or if the database was not running etc.

The getUserInfo and getDebugInfo methods does include the Oracle error
text but not in a form that can be simply printed. Third party
packages may use getMessage without realizing its limitations with the
Oracle driver.

I apologize if the intent of the getMessage call actually is to print
the generic PEAR DB message. This is not clear from the documentation
and I'm not familar with other driver's code. GetMessage seems to be
documented in PEAR_Error::getMessage() as "Returns the error message
coming with the error object.", whatever that means.

Reproduce code:
---------------
See the testcase in http://pear.php.net/bugs/bug.php?id=590
Change all occurences of MDB to DB as mentioned in the bug.

Expected result:
----------------
getMessage: ORA-01017: invalid username/password; logon denied
getUserInfo: [nativecode=ORA-01017: invalid username/password; logon denied] ** oci8://scott:tiger2@MYDB
getDebugInfo: [nativecode=ORA-01017: invalid username/password; logon denied] ** oci8://scott:tiger2@MYDB

Actual result:
--------------
getMessage: DB Error: connect failed
getUserInfo: [nativecode=ORA-01017: invalid username/password;
logon denied
] ** oci8://scott:tiger2@MYDB
getDebugInfo: [nativecode=ORA-01017: invalid username/password;
logon denied
] ** oci8://scott:tiger2@MYDB

[2004-01-22 23:37 UTC] cjbj at hotmail dot com

Fair enough.

What can be done to improve the documentation on this point?

[2004-01-22 23:37 UTC] cjbj at hotmail dot com

Fair enough.

What can be done to improve the documentation on this point?

[2004-02-27 04:25 UTC] cjbj at hotmail dot com

The PEAR Error doc for getMessage is "Returns the error message coming with the error object.". Could the PEAR DB doc be improved by mentioning that the errors messages are generic across all drivers?